Skip to content

Webhook avatars were stored full size and never resized (GRYT-1185) - #569

Merged
sivert-io merged 1 commit into
mainfrom
claude/GRYT-1185-webhook-avatar-resize
Sep 15, 2026
Merged

sivert-io merged 1 commit into
mainfrom
claude/GRYT-1185-webhook-avatar-resize

Conversation

@sivert-io

@sivert-io sivert-io commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

Vikunja: GRYT-1185. Server: Gryt-chat/server#191. Docs: Gryt-chat/docs#115.

The webhook tab uploaded its avatar through POST /api/uploads. So the server kept it at whatever size it was sent. Now it uses POST /api/uploads/webhook-avatar, which resizes it like any other avatar and leaves your own avatar alone.

Older servers: a server without the route answers 404. The tab then says "This server needs an update before you can change a webhook's avatar." and the webhook keeps the avatar it had. It doesn't retry through /api/uploads, because that would store the picture full size again. That's what client#561 did for group pictures. No released server has the route yet. Until one does, changing a webhook's avatar gives that message on every server.

  • utils/uploadWebhookAvatar.ts posts to the new route and throws the update message on a 404. It still reads fileId, and a refusal still carries the server's message.
  • scripts/check-webhook-avatar-upload.mjs checks the route and header, a refusal's message, that a 404 gives the update message with no second request, and that the tab doesn't call an upload route itself. I mutation-checked it: pointing at the old route, falling back to /api/uploads on a 404, and treating a 404 like any other refusal each make it fail.

How I checked

Throwaway server on the server branch with filesystem storage, this branch on :3687, headless Chrome:

  • Uploading a 5.9 MB 2400×1600 PNG from the webhooks tab sent one POST /api/uploads/webhook-avatar (201), then the PATCH. The server stored a 599-byte 256×256 AVIF with a 128 px thumbnail, and my own avatar stayed empty.
  • A message posted to the webhook URL showed the avatar, loaded at 256×256.
  • Then I restarted the server from main on the same data. The upload got a 404 and the tab showed the update message. Nothing else was requested, no file was stored, and the webhook kept its avatar.

yarn lint, yarn build and every test:* step in CI pass locally.

🤖 Generated with Claude Code

The webhook tab uploaded its avatar through POST /api/uploads. So the server
kept it at whatever size it was sent. Now it uses POST
/api/uploads/webhook-avatar, which resizes it like any other avatar and leaves
your own avatar alone.

An older server answers that route with a 404. The tab then says "This server
needs an update before you can change a webhook's avatar." It doesn't retry
through /api/uploads, because that would store it full size again. The webhook
keeps the avatar it had.

scripts/check-webhook-avatar-upload.mjs covers the route, the 404 message, and
that nothing else gets called after a 404.

Co-Authored-By: Claude Opus 5 <[email protected]>
@sivert-io
sivert-io merged commit f8990d6 into main Sep 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant