Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4d5776f. Configure here.
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.

Description
Token metadata and balance are currently fetched in parallel by
AccountApiClient. When the Account API balance request fails, for example with HTTP 403, the rejected balance promise causes theentire
Promise.allto reject. The metadata request may have succeeded, but the token metadata service then falls back to the blockchain client, which cannot provide token icon URLs.This change makes balance resolution independent from metadata resolution:
Related issues
Fixes: #
Manual testing steps
http://localhost:8000.Automated verification:
yarn workspace @metamask/gator-permissions-snap test test/client/accountApiClient.test.ts test/services/tokenMetadataService.test.ts test/core/confirmation/ConfirmationShell.test.ts --runInBandyarn eslint packages/gator-permissions-snap/src/clients/accountApiClient.ts packages/gator-permissions-snap/src/clients/types.ts packages/gator-permissions-snap/src/core/confirmation/ConfirmationShell.ts packages/gator-permissions-snap/test/client/accountApiClient.test.tsScreenshots/Recordings
Before
The Account API balance request failure caused the combined balance and metadata request to reject, so the flow fell back to the blockchain client and the token icon was unavailable.

After
The balance failure is treated as an unavailable balance. Token metadata and the icon URL continue to resolve independently.

Pre-merge author checklist
Standards.
Pre-merge reviewer checklist
Note
Low Risk
Scoped to permission confirmation token display and Account API error handling; grant logic is unchanged and metadata failures still propagate as before.
Overview
When the Account API balance call fails (e.g. HTTP 403),
getTokenBalanceAndMetadatano longer rejects the combined fetch: the balance promise is caught, logged, and resolved asbalance: undefined, while metadata (includingiconUrl) still completes viaPromise.all.The confirmation flow treats a missing balance as unavailable rather than a hard failure:
ConfirmationShellsetstokenBalanceUnavailable, skips token/fiat formatting, andConfirmationShellContenthides the balance row instead of showing loading skeletons.TokenBalanceAndMetadata.balanceis typed asbigint | undefined, with client and shell tests updated for partial success and unavailable-balance UI.Reviewed by Cursor Bugbot for commit 1460d94. Bugbot is set up for automated code reviews on this repo. Configure here.