Actions
Sub-Task #122
openEpic #105: Account & Preferences Management
Feature #106: Update profile information
User Story #108: As a user, I want to upload a custom avatar, so that my identity is visually recognizable across the platform.
Integrate S3/local storage for avatar upload (backend)
Sub-Task #122:
Integrate S3/local storage for avatar upload (backend)
Start date:
11/04/2026
Due date:
% Done:
100%
Estimated time:
Description
Technical specification of the avatar API and of how an uploaded image becomes an avatar. The storage backends are in #307.
API:
PUT /api/v1/me/avatartakes the image as the raw body, 2 MB at most, and returns the current user.DELETE /api/v1/me/avatarremoves the avatar and succeeds when there is none.GET /api/v1/users/{id}/avatarreturns the image to any signed-in user, with anETagand a cache header. A request that already has the currentETaggets 304. A user without avatar gets 404.- The user response and the user summaries carry
avatar_url, versioned by the date of the avatar, so a cache can keep the image for good. It is null without avatar. - An account that signs in through a login provider is refused with 403.
- Errors are Problem Details documented in the OpenAPI schema: 401 without a session, 413 for a file or an image that is too large, 422 for a file that is not a supported image.
Image:
- The image is decoded with limits on its size, cropped to its centre square, scaled to 256 pixels and stored as WebP. Metadata of the original is not kept. This is done by a helper shared with every feature that takes an image.
Data:
- The account keeps the key of its avatar and the date it was set. The new file is stored first, then the account points to it, then the previous file is deleted. If the account cannot be updated, the new file is deleted.
- Each change is written to the change log.
Acceptance criteria:
- An image becomes the avatar, and is served as WebP with an
ETag. - A file that is not an image, or is too large, is refused with the right status.
- Replacing or removing the avatar deletes the previous file.
- A login provider account cannot change its avatar.
- Each change is in the change log.
- Every case is covered by a test, with a real database.
Actions