fix: added check for native assets for fetch balance after transaction confirmation - #10198
Open
gabrieledm wants to merge 2 commits into
Open
fix: added check for native assets for fetch balance after transaction confirmation#10198gabrieledm wants to merge 2 commits into
gabrieledm wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
This PR fixes post-transaction balance refreshes for default-tracked native assets on chains where
AccountActivityDataSourceis active.Previously,
AssetsControllerskipped the full post-transactiongetAssetsrefresh 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 -> USDCon 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
forceUpdateandbypassServerCache.Changes
eip155:5042) confirming the refresh still runs when AccountActivity marks the chain active.References
Checklist
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
#refreshAssetsForTransactionskipped the post-confirmationgetAssets({ 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:ingetDefaultTrackedAssetsForChain). Otherwise the forced Accounts API fetch still runs. A regression test covers AccountActivity-up +transactionConfirmedon Arc (0x13b2).Reviewed by Cursor Bugbot for commit fa0a609. Bugbot is set up for automated code reviews on this repo. Configure here.