fix: capture Asset image URL fallback errors#39742
Merged
Prithpal-Sooriya merged 5 commits intomainfrom Feb 9, 2026
Merged
Conversation
Co-authored-by: prithpal.sooriya <prithpal.sooriya@consensys.net>
|
Cursor Agent can help with this pull request. Just |
Contributor
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Prithpal-Sooriya
commented
Feb 3, 2026
Comment on lines
+96
to
101
| log.error('Failed to get asset image URL', { | ||
| error: error instanceof Error ? error.message : String(error), | ||
| assetId, | ||
| chainId, | ||
| }); | ||
| return undefined; |
Contributor
Author
There was a problem hiding this comment.
Safely capturing error and returning undefined.
Keeping some error logs for now.
Contributor
Builds ready [a33766f]
UI Startup Metrics (1371 ± 94 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Contributor
Builds ready [9cd525e]
UI Startup Metrics (1398 ± 110 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Contributor
Builds ready [89ca27f]
UI Startup Metrics (1333 ± 92 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
…rsor/asset-image-url-errors-687a
…ask/metamask-extension into cursor/asset-image-url-errors-687a
Contributor
Builds ready [0af59a5]
UI Startup Metrics (1388 ± 101 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
sahar-fehri
approved these changes
Feb 6, 2026
juanmigdr
approved these changes
Feb 9, 2026
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.
Description
https://consensys.slack.com/archives/C0AA1T3BD2T/p1770118966868099?thread_ts=1769712946.739669&cid=C0AA1T3BD2T
Catch and log errors in
getAssetImageUrlto preventgetNativeAssetForChainIderrors from propagating, as observed in Sentry.An underlying bridge util to fetch native asset Ids will throw an error for unsupported asset Ids.
We use util as part of the asset image fallback utility.
Now we capture this error instead of propagating.
Changelog
CHANGELOG entry: fix: capture Asset image URL fallback errors
Related issues
Fixes: #39743
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Small, defensive change limited to asset icon URL construction; it only adds error handling/logging and keeps returning
undefinedon failure.Overview
getAssetImageUrlis now wrapped in atry/catchso failures while converting to a CAIPassetId(e.g., fromgetNativeAssetForChainIdon unsupported/custom chains) no longer propagate and break callers.On error it logs a structured message via
loglevel(includingassetIdandchainId) and returnsundefined, preserving the existing fallback behavior when the URL cannot be constructed.Written by Cursor Bugbot for commit 0af59a5. This will update automatically on new commits. Configure here.