Repository navigation
Choosing a group picture replaced your own avatar (GRYT-1182) - #561
Merged
Merged
Conversation
GroupDialog uploaded the picture through /api/uploads/avatar, which also sets it as the uploader's avatar on that server. It uses the new /api/uploads/group-icon route now. A server without that route answers 404. The client doesn't retry on the avatar route, since that would bring the bug back. It says the server needs an update and the group keeps its drawn egg. It reads fileId from the reply, which the SVG path always sent, so an SVG group picture no longer errors either. Co-Authored-By: Claude Opus 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Vikunja: GRYT-1182. Needs the server route from Gryt-chat/server#185. Mobile: Gryt-chat/mobile#214. Docs: Gryt-chat/docs#108.
Picking a group's picture in GroupDialog uploaded it through
/api/uploads/avatar, which also made it your own avatar on that server. It uses the new/api/uploads/group-iconroute now.Older servers: if the new route answers 404, the client doesn't fall back to the avatar route, because that brings the bug back. It shows "This server needs an update before groups can have their own picture." and the group keeps its drawn egg. The rest of the dialog works as before. No released server has the route yet, so group pictures stop working everywhere until one does. Merge this after the server release.
utils/uploadGroupPicture.tsholds the upload. It readsfileId, which the avatar route's SVG path always sent instead ofavatarFileId, so an SVG group picture no longer errors.scripts/check-group-picture-upload.mjs(yarn test:group-picture-upload, added to CI) runs the helper against a fake fetch. It checks the route and header, that a refusal passes on the server's message, that a 404 gives the update message with no second request to the avatar route, and that GroupDialog uses the helper. Adding an avatar-route retry makes it fail.I checked it in headless Chrome against a throwaway server running the server branch, with three guests. One of them created a group with a picture. Their
avatar_file_idstayed null, the group'sicon_file_idwas the new file, and another member saw the picture load in their Messages list. On main the same steps set the uploader's avatar to the group picture. A server without the route answersCannot POST /api/uploads/group-iconwith a 404, which is what the fallback keys on.yarn lint,yarn buildand everytest:*step in CI pass locally.🤖 Generated with Claude Code