Skip to content

fix(profile-editor): render data: and blob: avatar URLs - #1128

Merged
coodos merged 1 commit into
mainfrom
fix/profile-editor-data-uri-avatars
Sep 3, 2026
Merged

fix(profile-editor): render data: and blob: avatar URLs#1128
coodos merged 1 commit into
mainfrom
fix/profile-editor-data-uri-avatars

Conversation

@coodos

@coodos coodos commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Problem

Avatars stored as inline data:image/...;base64,... URIs don't render in the profile editor — the image is broken everywhere an avatar/banner appears (profile header, discover cards).

resolveAssetUrl() in platforms/profile-editor/client/src/lib/utils/file-manager.ts treated anything that isn't an http(s) URL as a legacy bare file-manager id, so a data URI was percent-encoded and pasted onto the file-manager base:

https://file-manager.w3ds.metastate.foundation/api/public/files/data%3Aimage%2Fpng%3Bbase64%2CiVBORw0...

which 404s. Inline data URIs are a first-class avatar format in the ecosystem — the Web3 Adapter's __file() directive explicitly accepts avatarUrl as a data URI — so profiles synced in from other platforms hit this.

Fix

Pass through anything the browser can already render — http(s), protocol-relative, data: and blob: — and only prefix the file-manager base for a bare legacy id. blob: is included so local URL.createObjectURL previews stay safe if they're ever routed through this helper.

Verification

pnpm run check in platforms/profile-editor/client: 0 errors (11 pre-existing warnings, unchanged).

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: edabaa4f-2ba7-4867-b7ce-9e5d11f54128


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coodos
coodos merged commit 7db234e into main Sep 3, 2026
4 checks passed
@coodos
coodos deleted the fix/profile-editor-data-uri-avatars branch September 3, 2026 08:58
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