fix(keychain): fall back to collection image when token images fail - #2663
Merged
Merged
Conversation
Torii serves token images only under the zero-padded lowercase contract address, and some collections (e.g. Glitch Bomb) return token-level image bodies that are not decodable, so inventory cards, collection grids and activity/traceability rows rendered placeholders while the asset page recovered via its collection-image fallback. Centralize static image URL construction in torii-url helpers (normalized like cartridge-gg/arcade#300) and apply the asset page's fallback chain (token image -> legacy unpadded URL -> metadata image -> collection image) everywhere: collection hooks, activity feed, traceability cards and purchase views. ThumbnailCollectible now probes a list of candidates and displays the first one that actually decodes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Integrate the nested data-URI decoding from #2664: when token metadata wraps a plain URL inside a base64 data URI (e.g. Glitch Bomb), decode it and promote it ahead of the Torii candidates so the intended image loads first. Collection-level lists resolve the nested URI in place. Supersedes #2664. Co-Authored-By: Claude Fable 5 <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 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.
Summary
torii-url.tshelpers, normalizing the contract address (zero-padded lowercase, like fix(arcade-ts): normalize Torii asset addresses arcade#300) and padding the token id.ThumbnailCollectible(used by activity/traceability rows) now accepts a list of candidates and probes each one, since Torii can return a 200 whose body is not decodable image data.Root cause
Torii serves
/static/<contract>/<token>/imageonly under the zero-padded lowercase address form, and some collections (e.g. Glitch Bomb ongbomb-mainnet) have token metadata whose image is a base64-wrapped URL string, so the token-level endpoint returns undecodable content with a 200. Only the collection-level image (/static/<padded-contract>/image) reliably loads, and only the asset page preview fell back to it. Fixes the placeholder images reported on the inventory, collection, and activity surfaces.Validation
pnpm --filter @cartridge/keychain test(770 passed) including new unit tests for the URL helpers and nested-URI decodingpnpm --filter @cartridge/controller-ui test:ci,build,tsc --noEmiton both packagespnpm lint/pnpm formatgbomb-mainnetTorii: padded contract URLs return 200, unpadded 404, token-level body is a raw URL served asimage/svg+xmlPrompted by: bal7hazar
🤖 Generated with Claude Code