Skip to content

fix: added check for native assets for fetch balance after transaction confirmation - #10198

Open
gabrieledm wants to merge 2 commits into
mainfrom
fix/arc-usdc-native-not-updated-after-swap
Open

fix: added check for native assets for fetch balance after transaction confirmation#10198
gabrieledm wants to merge 2 commits into
mainfrom
fix/arc-usdc-native-not-updated-after-swap

Conversation

@gabrieledm

@gabrieledm gabrieledm commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Explanation

This PR fixes post-transaction balance refreshes for default-tracked native assets on chains where AccountActivityDataSource is active.

Previously, AssetsController skipped the full post-transaction getAssets refresh whenever the transaction chain was covered by AccountActivity, assuming websocket balance updates would keep balances fresh.
That works for most assets, but it can miss default-tracked native assets such as Arc native USDC (eip155:5042/slip44:5042).
As a result, after flows like swapping EURC -> USDC on Arc, the USDC balance could remain stale until a full asset re-scan was triggered by reloading the app or switching accounts.

This change keeps the existing AccountActivity skip optimization, but bypasses it for chains that have default-tracked native assets.
In those cases, the controller still runs the full post-transaction refresh with forceUpdate and bypassServerCache.

Changes

  • Detect whether the transaction chain has a default-tracked native asset.
  • Continue skipping redundant refreshes for regular AccountActivity-active chains.
  • Force-refresh default-tracked native assets after confirmed transactions, even when AccountActivity is active.
  • Add test for Arc (eip155:5042) confirming the refresh still runs when AccountActivity marks the chain active.

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

Medium Risk
Changes post-transaction balance refresh gating on AccountActivity-active chains; scope is narrow but affects visible balance correctness and reintroduces forced fetches where WebSocket coverage was assumed sufficient.

Overview
Fixes stale default-tracked native balances (e.g. Arc USDC at eip155:5042/slip44:5042) after a transaction confirms when AccountActivity already owns live updates on that chain.

Previously #refreshAssetsForTransaction skipped the post-confirmation getAssets({ forceUpdate: true, bypassServerCache: true }) whenever the chain was AccountActivity-active, to avoid racing the WebSocket path. AccountActivity can miss updates for those default-tracked native assets, so balances could stay wrong until another refresh.

The skip now applies only when the chain has no default-tracked native asset (/slip44: in getDefaultTrackedAssetsForChain). Otherwise the forced Accounts API fetch still runs. A regression test covers AccountActivity-up + transactionConfirmed on Arc (0x13b2).

Reviewed by Cursor Bugbot for commit fa0a609. 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 11, 2026 14:40
@gabrieledm
gabrieledm deployed to default-branch September 11, 2026 14:40 — with GitHub Actions Active
@gabrieledm
gabrieledm requested a review from a team as a code owner September 11, 2026 14:48
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