Skip to content

fix: force RPC slow pipeline to update balances - #10058

Open
gabrieledm wants to merge 3 commits into
mainfrom
fix/WPN-1954_balance-does-not-update-after-usdc-eurc-or-eurc-usdc-swap-max
Open

fix: force RPC slow pipeline to update balances#10058
gabrieledm wants to merge 3 commits into
mainfrom
fix/WPN-1954_balance-does-not-update-after-usdc-eurc-or-eurc-usdc-swap-max

Conversation

@gabrieledm

@gabrieledm gabrieledm commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Explanation

Fixes stale ARC USDC/EURC balances after confirmed swaps by ensuring post-transaction asset refreshes use an authoritative RPC balance pass.
Previously, confirmed transaction refreshes could be skipped on AccountActivity-active chains.
This meant one side of a swap could update while the other remained stale until switching accounts forced a full refresh.

This change:

  • Marks confirmed transaction refreshes as post-transaction refreshes
  • Allows confirmed transaction refreshes to run even when AccountActivity is active
  • Forces the post-transaction slow pipeline to use RPC
  • Includes already-tracked balance assets in post-transaction RPC requests, so graduated ERC-20s are refreshed too
  • Keeps unapproved transaction refreshes skipped on AccountActivity-active chains

Tests

Added regression coverage in AssetsController.test.ts for:

  • RPC being used as the authoritative post-transaction slow pipeline
  • tracked ARC EURC being included in the RPC request
  • ARC native USDC and EURC balances updating from the RPC response
  • unapproved transactions still being skipped on AccountActivity-active chains
  • confirmed transactions refreshing even on AccountActivity-active chains

References

Fixes: WPN-1954

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

Medium Risk
Changes balance refresh timing and data-source precedence after confirmations on live chains; incorrect RPC or merge behavior could show wrong balances, but scope is limited to post-confirmation refresh paths with regression tests.

Overview
Fixes stale swap balances (e.g. ARC USDC/EURC) by treating confirmed transaction refreshes differently from pre-confirmation ones.

Confirmed transactions now call getAssets with postTransaction: true. That flag still runs a force refresh on AccountActivity-active chains (only unapproved txs keep skipping those chains), forces the slow pipeline to RPC-only (no Snap), and makes #getSlowPipelineChainIds run RPC on all requested chains instead of skipping chains the Accounts API already “covered.” Post-transaction fetches also add graduated ERC-20s from existing assetsBalance into the RPC customAssets list so the “receive” side of a swap is queried on-chain.

Tests cover the ARC RPC path, postTransaction on transactionConfirmed, and the split behavior for unapproved vs confirmed on AccountActivity chains. Changelog notes the fix.

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

@gabrieledm
gabrieledm requested a review from a team as a code owner September 1, 2026 20:14
@gabrieledm
gabrieledm deployed to default-branch September 1, 2026 20:14 — with GitHub Actions Active
@gabrieledm
gabrieledm requested a review from a team as a code owner September 1, 2026 20:16

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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.

Fix All in Cursor

❌ 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 ad7c150. Configure here.

Comment thread packages/assets-controller/src/AssetsController.ts
@cursor
cursor Bot requested review from Kriys94 and salimtb September 1, 2026 20:22
@gabrieledm

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/account-tree-controller@8.0.0-preview-64bce4b11
@metamask-previews/accounts-controller@39.1.1-preview-64bce4b11
@metamask-previews/address-book-controller@7.1.2-preview-64bce4b11
@metamask-previews/ai-controllers@1.0.0-preview-64bce4b11
@metamask-previews/analytics-controller@2.0.0-preview-64bce4b11
@metamask-previews/analytics-data-regulation-controller@0.0.0-preview-64bce4b11
@metamask-previews/announcement-controller@8.1.0-preview-64bce4b11
@metamask-previews/app-metadata-controller@2.0.1-preview-64bce4b11
@metamask-previews/approval-controller@9.0.2-preview-64bce4b11
@metamask-previews/assets-controller@14.0.3-preview-64bce4b11
@metamask-previews/assets-controllers@111.1.3-preview-64bce4b11
@metamask-previews/authenticated-user-storage@3.0.2-preview-64bce4b11
@metamask-previews/base-controller@9.1.0-preview-64bce4b11
@metamask-previews/base-data-service@1.0.0-preview-64bce4b11
@metamask-previews/bitcoin-regtest-up@1.0.0-preview-64bce4b11
@metamask-previews/bridge-controller@80.1.1-preview-64bce4b11
@metamask-previews/bridge-status-controller@75.4.0-preview-64bce4b11
@metamask-previews/build-utils@3.0.4-preview-64bce4b11
@metamask-previews/chain-agnostic-permission@1.7.0-preview-64bce4b11
@metamask-previews/chomp-api-service@4.0.1-preview-64bce4b11
@metamask-previews/claims-controller@0.6.1-preview-64bce4b11
@metamask-previews/client-controller@1.0.1-preview-64bce4b11
@metamask-previews/client-utils@2.1.1-preview-64bce4b11
@metamask-previews/compliance-controller@2.1.0-preview-64bce4b11
@metamask-previews/composable-controller@12.0.1-preview-64bce4b11
@metamask-previews/config-registry-controller@3.1.0-preview-64bce4b11
@metamask-previews/connectivity-controller@0.3.0-preview-64bce4b11
@metamask-previews/controller-utils@12.3.0-preview-64bce4b11
@metamask-previews/core-backend@9.0.0-preview-64bce4b11
@metamask-previews/delegation-controller@3.0.2-preview-64bce4b11
@metamask-previews/earn-controller@12.2.6-preview-64bce4b11
@metamask-previews/eip-5792-middleware@3.0.5-preview-64bce4b11
@metamask-previews/eip-7702-internal-rpc-middleware@0.1.1-preview-64bce4b11
@metamask-previews/eip1193-permission-middleware@2.0.1-preview-64bce4b11
@metamask-previews/eth-block-tracker@15.0.1-preview-64bce4b11
@metamask-previews/eth-json-rpc-middleware@24.0.2-preview-64bce4b11
@metamask-previews/eth-json-rpc-provider@6.0.1-preview-64bce4b11
@metamask-previews/foundryup@1.0.1-preview-64bce4b11
@metamask-previews/gas-fee-controller@26.3.2-preview-64bce4b11
@metamask-previews/gator-permissions-controller@5.0.2-preview-64bce4b11
@metamask-previews/geolocation-controller@1.0.0-preview-64bce4b11
@metamask-previews/java-tron-up@1.0.0-preview-64bce4b11
@metamask-previews/json-rpc-engine@10.5.0-preview-64bce4b11
@metamask-previews/json-rpc-middleware-stream@8.0.8-preview-64bce4b11
@metamask-previews/keyring-controller@27.1.1-preview-64bce4b11
@metamask-previews/kyc-controller@0.0.0-preview-64bce4b11
@metamask-previews/local-node-utils@1.0.0-preview-64bce4b11
@metamask-previews/logging-controller@9.0.0-preview-64bce4b11
@metamask-previews/message-manager@14.1.2-preview-64bce4b11
@metamask-previews/messenger@2.0.0-preview-64bce4b11
@metamask-previews/messenger-cli@0.2.0-preview-64bce4b11
@metamask-previews/money-account-api-data-service@0.4.1-preview-64bce4b11
@metamask-previews/money-account-balance-service@2.4.3-preview-64bce4b11
@metamask-previews/money-account-controller@1.0.0-preview-64bce4b11
@metamask-previews/money-account-upgrade-controller@3.0.2-preview-64bce4b11
@metamask-previews/money-account-utils@1.1.0-preview-64bce4b11
@metamask-previews/multichain-account-service@13.0.2-preview-64bce4b11
@metamask-previews/multichain-api-middleware@4.0.3-preview-64bce4b11
@metamask-previews/multichain-network-controller@3.2.4-preview-64bce4b11
@metamask-previews/multichain-transactions-controller@7.1.2-preview-64bce4b11
@metamask-previews/name-controller@9.1.2-preview-64bce4b11
@metamask-previews/network-connection-banner-controller@0.2.1-preview-64bce4b11
@metamask-previews/network-controller@36.0.0-preview-64bce4b11
@metamask-previews/network-enablement-controller@6.0.5-preview-64bce4b11
@metamask-previews/notification-services-controller@26.0.1-preview-64bce4b11
@metamask-previews/passkey-controller@3.1.0-preview-64bce4b11
@metamask-previews/permission-controller@13.1.1-preview-64bce4b11
@metamask-previews/permission-log-controller@5.1.0-preview-64bce4b11
@metamask-previews/perps-controller@15.0.0-preview-64bce4b11
@metamask-previews/phishing-controller@17.4.0-preview-64bce4b11
@metamask-previews/platform-api-docs@0.1.0-preview-64bce4b11
@metamask-previews/polling-controller@16.0.9-preview-64bce4b11
@metamask-previews/preferences-controller@23.1.0-preview-64bce4b11
@metamask-previews/profile-metrics-controller@4.0.3-preview-64bce4b11
@metamask-previews/profile-sync-controller@29.0.0-preview-64bce4b11
@metamask-previews/ramps-controller@20.2.0-preview-64bce4b11
@metamask-previews/rate-limit-controller@7.0.1-preview-64bce4b11
@metamask-previews/react-data-query@1.0.0-preview-64bce4b11
@metamask-previews/remote-feature-flag-controller@6.1.0-preview-64bce4b11
@metamask-previews/sample-controllers@5.0.6-preview-64bce4b11
@metamask-previews/seedless-onboarding-controller@10.1.1-preview-64bce4b11
@metamask-previews/selected-network-controller@26.1.7-preview-64bce4b11
@metamask-previews/sentinel-api-service@1.0.1-preview-64bce4b11
@metamask-previews/shield-controller@6.0.1-preview-64bce4b11
@metamask-previews/signature-controller@39.2.10-preview-64bce4b11
@metamask-previews/smart-transactions-controller@26.0.0-preview-64bce4b11
@metamask-previews/snap-account-service@2.1.2-preview-64bce4b11
@metamask-previews/social-controllers@2.8.0-preview-64bce4b11
@metamask-previews/solana-test-validator-up@1.0.0-preview-64bce4b11
@metamask-previews/stellar-quickstart-up@0.0.0-preview-64bce4b11
@metamask-previews/storage-service@1.0.2-preview-64bce4b11
@metamask-previews/subscription-controller@8.0.1-preview-64bce4b11
@metamask-previews/transaction-controller@69.7.0-preview-64bce4b11
@metamask-previews/transaction-pay-controller@27.1.1-preview-64bce4b11
@metamask-previews/user-operation-controller@41.2.9-preview-64bce4b11
@metamask-previews/wallet@12.0.2-preview-64bce4b11
@metamask-previews/wallet-cli@0.0.0-preview-64bce4b11

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.

1 participant