Skip to content

fix(assets-controller): AccountsAPI call when non-EVM chain down in WS - #10585

Merged
Kriys94 merged 3 commits into
mainfrom
fix/UpdateNonEVMAssetsTx
Sep 30, 2026
Merged

Kriys94 merged 3 commits into
mainfrom
fix/UpdateNonEVMAssetsTx

Conversation

@Kriys94

@Kriys94 Kriys94 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

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

Medium Risk
Breaking messenger wiring is required for all consumers; incorrect delegation would silently skip non-EVM post-tx balance updates.

Overview
Non-EVM (Snap keyring) confirmed transactions now trigger the same post-tx balance refresh as EVM TransactionController:transactionConfirmed: when AccountActivity is not active on that chain, AssetsController force-calls getAssets with bypassServerCache: true for the selected account on the transaction’s CAIP-2 chain.

This adds a subscription to MultichainTransactionsController:transactionConfirmed, a dependency on @metamask/multichain-transactions-controller, and refactors the EVM handler into #refreshAssetsForEVMTransaction / #refreshAssetsForNonEvmTransaction sharing #refreshAssetsAfterConfirmed (AccountActivity skip, account match, cache bypass).

Breaking: AssetsControllerMessenger must allow and delegate MultichainTransactionsController:transactionConfirmed onto the Assets messenger, or the handler never runs. Tests cover selected vs other accounts, AccountActivity up/down, and invalid chains.

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

@Kriys94
Kriys94 force-pushed the fix/UpdateNonEVMAssetsTx branch from 29304b0 to 957d62a Compare September 29, 2026 20:59
@Kriys94
Kriys94 force-pushed the fix/UpdateNonEVMAssetsTx branch from 957d62a to b14ff0f Compare September 30, 2026 09:42
@Kriys94
Kriys94 marked this pull request as ready for review September 30, 2026 14:20
@Kriys94
Kriys94 requested review from a team as code owners September 30, 2026 14:20
@Kriys94
Kriys94 deployed to default-branch September 30, 2026 14:21 — with GitHub Actions Active
}),
);

await flushPromises();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disgusting 🤮

Not blocking but lets please not use flushPromises - it is an anti-pattern. Instead use waitFor

}),
);

await flushPromises();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.. ideally want to be careful with these - they introduce flake, test confusion, etc.

});
});

it('does not force refresh assets for a non-EVM transaction on an AccountActivity-active chain', async () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional - we can do this later.

A lot of these cases could possibly be caught as a test table - this can help test readability (only need to look through table instead of whole test implementation).

@Prithpal-Sooriya Prithpal-Sooriya left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with some test nits.

@Kriys94
Kriys94 added this pull request to the merge queue Sep 30, 2026
Merged via the queue into main with commit 06cd138 Sep 30, 2026
54 checks passed
@Kriys94
Kriys94 deleted the fix/UpdateNonEVMAssetsTx branch September 30, 2026 16:52
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