Feat/stellar/enrichment client side#33084
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
There was a problem hiding this comment.
this is an update of the patch to include this fix: MetaMask/core#9453
otherwise balance update drops metadata
There was a problem hiding this comment.
updated the snap to latest version by patching it
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
⚡ Performance Test Results
✅ All tests passed · 2 tests · 1 device 📱 Devices tested (1)Android: Google Pixel 8 Pro (v14.0) ✅ Passed Tests (2)
Branch: |
| } | ||
| } | ||
| } else { | ||
| await MultichainAssetsController.addAssets( |
There was a problem hiding this comment.
this is by purpose, dont move it here
our plan is to remove asset enrich from old controller, and do it on new controller
Description
Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Touches core
AssetsControllerbalance merge and account-tree refresh paths used by unified assets state; incorrect merging could affect displayed balances or metadata across chains, though the change is narrowly scoped to merge semantics and new-account fetching.Overview
Extends the vendored
@metamask/assets-controllerYarn patch so balance updates behave correctly with client-side Stellar trustline/metadata enrichment.mergeAccountBalancesno longer shallow-merges per account; for each asset id it merges into the existing balance object (defaultingamountto'0'when missing) so partial updates—e.g. enrichment writingmetadataviahandleAssetsUpdatewithupdateMode: 'merge'—are not wiped when a later fetch only suppliesamount.On account tree changes, the controller now tracks newly added accounts and, after the usual refresh, runs an extra
getAssetsfor those accounts across all enabled chains, so multichain/Stellar balances populate when accounts are added without a full restart.A small refactor in
_AssetsController_handleAccountGroupChangedreuses a cachedaccountsvariable when fetching balances for newly enabled chains (behavior unchanged).Reviewed by Cursor Bugbot for commit 21fb2ca. Bugbot is set up for automated code reviews on this repo. Configure here.