Skip to content

chore(runway): cherry-pick fix: AccountsApiBalanceFetcher stricter zero out conditions#26642

Merged
joaoloureirop merged 1 commit intorelease/7.67.0from
cherry-pick-7-67-0-ed2fb6c
Feb 26, 2026
Merged

chore(runway): cherry-pick fix: AccountsApiBalanceFetcher stricter zero out conditions#26642
joaoloureirop merged 1 commit intorelease/7.67.0from
cherry-pick-7-67-0-ed2fb6c

Conversation

@runway-github
Copy link
Copy Markdown
Contributor

@runway-github runway-github bot commented Feb 26, 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 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.0 that tightens AccountsApiBalanceFetcher “zero-out” behavior: missing native and ERC-20 balances are only backfilled with 0 when the chainId was included in the original request and supports(chainId) is true.

Updates package.json and yarn.lock to consume the patched dependency via .yarn/patches/....

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

ed2fb6c

…#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 -->
@runway-github runway-github bot requested a review from a team as a code owner February 26, 2026 17:58
@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.

@metamaskbot metamaskbot added the team-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label Feb 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - base branch is not main (base: release/7.67.0)

All E2E tests pre-selected.

View GitHub Actions results

@joaoloureirop joaoloureirop added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Feb 26, 2026
@joaoloureirop joaoloureirop enabled auto-merge (squash) February 26, 2026 18:39
@joaoloureirop joaoloureirop merged commit d1cd8e8 into release/7.67.0 Feb 26, 2026
201 of 206 checks passed
@joaoloureirop joaoloureirop deleted the cherry-pick-7-67-0-ed2fb6c branch February 26, 2026 19:13
@github-actions github-actions bot locked and limited conversation to collaborators Feb 26, 2026
@metamaskbot metamaskbot added the release-7.67.0 Issue or pull request that will be included in release 7.67.0 label Feb 27, 2026
@metamaskbot
Copy link
Copy Markdown
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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.67.0 Issue or pull request that will be included in release 7.67.0 size-S skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants