This repository was archived by the owner on Jul 6, 2026. It is now read-only.
fix(avatar): serve avatars via API proxy (uploaded images now display)#89
Merged
Conversation
UploadAvatarCommandHandler stored the raw S3 object key in user.AvatarUrl, and MinIO is internal-only (no public ingress, no extra subdomain allowed) — so neither the key nor an internal presigned URL is browser-reachable. Result: avatars never rendered. - Add an anonymous GET /api/v1/profile/avatar?key=... endpoint that streams the object from MinIO through the API (the api host is public). - IFileStorageService: GetObjectAsync (buffered) + GetPublicUrl(key); StorageOptions gains PublicBaseUrl (values.yaml=https://api.project-01.gjirafa.dev, dev=:8081). - Upload now stores the absolute proxy URL, so every render site works unchanged. - Profile cards update authStore on upload so the top-right avatar refreshes live. Note: pre-existing avatars stored as raw keys stay broken until re-uploaded. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Bug: after uploading a profile picture (freelancer + enterprise), it never shows — not on the edit page nor the top-right circle.
Root cause (verified):
UploadAvatarCommandHandlerstored the raw S3 object key (avatars/<id>/file.png) inuser.AvatarUrl, and MinIO is internal-only (minio:9000, no public ingress; mentor cluster allows no extra subdomain). So neither the key nor an internal presigned URL is reachable from a browser →<img>404s.Fix: serve avatars through the API (the api host is already public):
GET /api/v1/profile/avatar?key=…streams the object from MinIO.StorageOptions.PublicBaseUrl(prodhttps://api.project-01.gjirafa.dev, dev:8081).authStoreon upload → top-right avatar refreshes live.Note: the one pre-existing avatar (stored as a raw key) stays broken until re-uploaded.
Verified:
dotnet build✓, unit tests 22/22 ✓,tsc✓,next lint0 ✓.