Skip to content

fix: AccountsApiBalanceFetcher stricter zero out conditions cp-7.67.0#26590

Merged
Prithpal-Sooriya merged 8 commits intomainfrom
fix/patch-asset-zero-out-strictness-check
Feb 26, 2026
Merged

fix: AccountsApiBalanceFetcher stricter zero out conditions cp-7.67.0#26590
Prithpal-Sooriya merged 8 commits intomainfrom
fix/patch-asset-zero-out-strictness-check

Conversation

@Prithpal-Sooriya
Copy link
Copy Markdown
Contributor

@Prithpal-Sooriya Prithpal-Sooriya commented Feb 25, 2026

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

  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

Screenshots/Recordings

Before

After

https://www.loom.com/share/d6e472d2ab444205acdad64507f43eed

Pre-merge author checklist

Pre-merge reviewer checklist

  • 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.

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.

Written by Cursor Bugbot for commit c3c5058. This will update automatically on new commits. Configure here.

@Prithpal-Sooriya Prithpal-Sooriya requested a review from a team as a code owner February 25, 2026 18:00
@github-actions
Copy link
Copy Markdown
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 Prithpal-Sooriya changed the title fix: AccountsApiBalanceFetcher stricter zero out conditions fix: AccountsApiBalanceFetcher stricter zero out conditions cp-7.67.0 Feb 25, 2026
salimtb
salimtb previously approved these changes Feb 25, 2026
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

juanmigdr
juanmigdr previously approved these changes Feb 26, 2026
@Prithpal-Sooriya
Copy link
Copy Markdown
Contributor Author

wow weird, got latest and CI is failing bad... Will cancel and retry CI

…d yarn.lock

- Updated the version of `@metamask/assets-controllers` from `100.0.1` to `100.0.3` in both `package.json` and `yarn.lock`.
- Adjusted the patching references accordingly to ensure consistency across dependencies.
…m:MetaMask/metamask-mobile into fix/patch-asset-zero-out-strictness-check
…e.json and yarn.lock

- Removed redundant patch references for `@metamask/assets-controllers` in `package.json`.
- Updated `yarn.lock` to reflect the changes in patch references for consistency.
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeConfirmations, SmokeIdentity, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeTrade, SmokeWalletPlatform, SmokeCard, SmokePerps, SmokeRamps, SmokeMultiChainAPI, SmokePredictions, FlaskBuildTests
  • Selected Performance tags: @PerformanceAccountList, @PerformanceOnboarding, @PerformanceLogin, @PerformanceSwaps, @PerformanceLaunch, @PerformanceAssetLoading, @PerformancePredict, @PerformancePreps
  • Risk Level: high
  • AI Confidence: 100%
click to see 🤖 AI reasoning details

E2E Test Selection:
Hard rule (controller-version-update): @MetaMask controller package version updated in package.json: @metamask/assets-controllers@npm:^99.4.0, @metamask/assets-controllers. Running all tests.

Performance Test Selection:
Hard rule (controller-version-update): @MetaMask controller package version updated in package.json: @metamask/assets-controllers@npm:^99.4.0, @metamask/assets-controllers. Running all tests.

View GitHub Actions results

@Prithpal-Sooriya Prithpal-Sooriya added this pull request to the merge queue Feb 26, 2026
Merged via the queue into main with commit ed2fb6c Feb 26, 2026
113 checks passed
@Prithpal-Sooriya Prithpal-Sooriya deleted the fix/patch-asset-zero-out-strictness-check branch February 26, 2026 17:43
@github-actions github-actions bot locked and limited conversation to collaborators Feb 26, 2026
@metamaskbot metamaskbot added the release-7.68.0 Issue or pull request that will be included in release 7.68.0 label Feb 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.68.0 Issue or pull request that will be included in release 7.68.0 size-S team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Native token balances for all popular networks displayed as 0 in the token list

7 participants