S2: DELETE /api/v1/identity/avatar #18
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
posta/server#18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
posta/server#15 — Operator-uploaded avatar served from the identity's URL
What to build
A
DELETE /api/v1/identity/avatarendpoint that removes the on-diskavatar file and clears the
identity.avatarcolumn. Backs theiOS "Remove photo" affordance and the symmetric ops case (operator
wants to unset an avatar without replacing it).
End-to-end behaviour after this slice:
DELETE /api/v1/identity/avatar(authenticated) removes theavatar-<hash>.<ext>file under the per-identity directory andclears
identity.avatarto''. Publishes anidentity-changedSSE event. Returns
204 No Content.avatarfield empty(omitted on the wire, since
ActorDoc.Avatarhas the omitempty JSONtag).
GET /avatar-<previous-hash>.<ext>returns404 no-avatar.DELETEagain when no avatar is set is a no-op: still returns204(idempotent — same shape as PUT being idempotent on identicalbytes).
Acceptance criteria
DELETE /api/v1/identity/avatarregistered on the authenticatedmux.
(tolerating "already absent"); store call clears the
identity.avatarcolumn.identity-changedSSE event published, same code path asPATCH /api/v1/identityand the newPUT /api/v1/identity/avatar.204 No Content. Empty body.204and is ano-op on disk and on the column.
newRigpattern) covers: PUT a PNG→ DELETE → identity.avatar column is empty → GET on the
previous URL returns
404→ DELETE again returns204.go build ./...andgo test ./...pass.Blocked by
posta/server#16 (S1: PNG avatar upload + public GET). The
avatar-storage module's remove path and the per-identity-mux
404behaviour for the GET route both land in S1.
Small follow-on to #16. Adds
DELETE /api/v1/identity/avatarfor the iOS "Remove photo" affordance — relies on the avatar-storage module's remove path and the per-identity GET route's404 no-avatarbehaviour landing in #16.Acceptance criteria above already function as an agent brief.
Category: enhancement
State: ready-for-agent