chore(runway): cherry-pick fix: AccountsApiBalanceFetcher stricter zero out conditions#26642
Merged
joaoloureirop merged 1 commit intorelease/7.67.0from Feb 26, 2026
Merged
Conversation
…#26590) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> Patch for the core fix: MetaMask/core#8044 https://consensyssoftware.atlassian.net/browse/ASSETS-2796 <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: fix: AccountsApiBalanceFetcher stricter zero out conditions Fixes: MetaMask/metamask-extension#40324 (this issue also happens on mobile!) #26618 1. Add avalanche and have avalanche tokens 2. Select avalanche only in the network picker - EXPECTED: see avalanche erc-20 balances 3. Select popular networks in the network picket - EXPECTED: see avalanche erc-20 balances <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> <!-- [screenshots/recordings] --> https://www.loom.com/share/d6e472d2ab444205acdad64507f43eed - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Touches cross-chain balance fetching behavior via a patched dependency; incorrect gating could still cause missing/incorrect displayed balances for some network selections. Dependency patching adds some upgrade/maintenance risk but is scoped to a small conditional change. > > **Overview** > Updates `@metamask/assets-controllers` via a Yarn patch to tighten when missing balances are backfilled as zero in `AccountsApiBalanceFetcher`. > > Zero-value native and ERC-20 balances are now only synthesized when the chain was *explicitly requested* (`chainIds.includes(chainId)`) and is *supported* (`supports(chainId)`), avoiding unintended zeroing for other chains. The app’s dependency wiring is updated (`package.json` + `yarn.lock`) to use the patched `@metamask/assets-controllers@100.0.3`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit c3c5058. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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. |
Contributor
🔍 Smart E2E Test Selection⏭️ Smart E2E selection skipped - base branch is not main (base: release/7.67.0) All E2E tests pre-selected. |
joaoloureirop
approved these changes
Feb 26, 2026
Collaborator
|
No release label on PR. Adding release label release-7.67.0 on PR, as PR was cherry-picked in branch 7.67.0. |
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
Patch for the core fix: MetaMask/core#8044
https://consensyssoftware.atlassian.net/browse/ASSETS-2796
Changelog
CHANGELOG entry: fix: AccountsApiBalanceFetcher stricter zero out
conditions
Related issues
Fixes: MetaMask/metamask-extension#40324 (this
issue also happens on mobile!) #26618
Manual testing steps
erc-20 balances
avalanche erc-20 balances
Screenshots/Recordings
Before
After
https://www.loom.com/share/d6e472d2ab444205acdad64507f43eed
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Note
Medium Risk
Touches balance-fetching logic (via a Yarn patch to
@metamask/assets-controllers), which can affect displayed native/ERC-20 balances across networks if the new gating conditions are wrong. Scope is small and isolated to when missing API results are backfilled with zeroes.Overview
Applies a Yarn patch to
@metamask/assets-controllers@99.4.0that tightensAccountsApiBalanceFetcher“zero-out” behavior: missing native and ERC-20 balances are only backfilled with0when thechainIdwas included in the original request andsupports(chainId)is true.Updates
package.jsonandyarn.lockto consume the patched dependency via.yarn/patches/....Written by Cursor Bugbot for commit 28f899b. This will update automatically on new commits. Configure here.
ed2fb6c