Skip to content

fix(community): load contributor avatars from open collective's image service - #516

Merged
TheMeinerLP merged 1 commit into
mainfrom
fix/community-wall-avatars
Oct 11, 2026
Merged

TheMeinerLP merged 1 commit into
mainfrom
fix/community-wall-avatars

Conversation

@TheMeinerLP

Copy link
Copy Markdown
Collaborator

Summary

The community wall (/community) showed broken contributor avatars. Open Collective avatars were passed through NuxtImg, so the Cloudflare resizer requested the S3 original, and it answers 403 for that origin.

This applies the approach from #513 (team supporter list) to the wall:

  • Open Collective avatars (S3 original or images.opencollective.com) map to the sized render of the supporter's profile, https://images.opencollective.com/<slug>/avatar/128.png. The S3 original (~800 KB) is never loaded.
  • The size is 128px: the wall box is 56px, so 2x is 112px. smallAvatarUrl takes an optional size, defaulting to 96 as before.
  • Avatars from other hosts (e.g. Minecraft heads) pass through unchanged.
  • Images are plain <img> without the resizer, with an @error fallback to the initial letter.

Rationale

The image service and the resizer are separate paths. Open Collective's own sized renders load directly, so no Cloudflare transform is needed. The mapping lives in layers/community/utils/avatars.ts and reuses smallAvatarUrl from shared/utils/liteSupporters.ts, which is already shared across layers.

Tests

  • tests/community/avatars.spec.ts (new): mapping for S3 and image-service origins, the null cases (no profile, no slug), pass-through for other hosts, and the size parameter of smallAvatarUrl.
  • tests/community/components.spec.ts: the supporter avatar uses the sized render, the resizer is not involved, and a failed avatar falls back to the initial.

Local: pnpm test (185 files, 1656 tests), pnpm quality (no regression), pnpm build all pass.

https://claude.ai/code/session_019zws4ceJu2jctk3XT48fMX

… service

The wall routed Open Collective avatars through the Cloudflare resizer, which answers 403 for that origin. Map them to the sized images.opencollective.com render of the profile, render them as plain images, and fall back to the initial when one fails to load.

Claude-Session: https://claude.ai/code/session_019zws4ceJu2jctk3XT48fMX
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
launchpad 120924e Commit Preview URL

Branch Preview URL
Oct 11 2026, 02:05 PM

@TheMeinerLP
TheMeinerLP merged commit 386dcab into main Oct 11, 2026
8 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