Skip to content

Revert "fix(assets-controller): increase stale and gc time for accounts api request (#9591) - #9870

Open
salimtb wants to merge 3 commits into
mainfrom
revert/accounts-api-stale-gc-9591
Open

Revert "fix(assets-controller): increase stale and gc time for accounts api request (#9591)#9870
salimtb wants to merge 3 commits into
mainfrom
revert/accounts-api-stale-gc-9591

Conversation

@salimtb

@salimtb salimtb commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

This reverts commit 1b082f7.

Extension PR: MetaMask/metamask-extension#45494
Mobile PR: MetaMask/metamask-mobile#34748

Explanation

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Low Risk
Narrow revert in balance-fetch caching only; may increase duplicate API calls during force-refresh bursts but restores correct fresh-balance behavior.

Overview
Reverts #9591 so AccountsApiDataSource again passes staleTime: 0 / gcTime: 0 to the Accounts API balance client when forceUpdate is true, instead of a 100ms cache window.

Forced balance refreshes (account switch, post-tx refresh, subscription handoffs, etc.) are meant to skip TanStack Query reuse; the short window could still serve a cached response. The unit test is renamed/updated to assert full cache bypass, and the changelog records the fix under Fixed.

Reviewed by Cursor Bugbot for commit 1176879. Bugbot is set up for automated code reviews on this repo. Configure here.

@salimtb salimtb changed the title Revert "fix(assets-controller): increase stale and gc time for accoun… Revert "fix(assets-controller): increase stale and gc time for accounts api request (#9591) Aug 13, 2026
salimtb added a commit to MetaMask/metamask-mobile that referenced this pull request Aug 13, 2026
Revert forceUpdate balance cache window from 100ms to staleTime/gcTime
0 so forced refreshes bypass TanStack cache (MetaMask/core#9870).
salimtb added a commit to MetaMask/metamask-extension that referenced this pull request Aug 13, 2026
Revert forceUpdate balance cache window from 100ms to staleTime/gcTime
0 so forced refreshes bypass TanStack cache (MetaMask/core#9870).
@salimtb
salimtb marked this pull request as ready for review August 13, 2026 14:44
@salimtb
salimtb requested review from a team as code owners August 13, 2026 14:44
@salimtb
salimtb deployed to default-branch August 13, 2026 14:45 — with GitHub Actions Active
juanmigdr
juanmigdr previously approved these changes Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants