fix: Tokens disappearing when updating #9148
Conversation
…solve the tokens issue
|
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. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9148 +/- ##
=======================================
Coverage 45.98% 45.99%
=======================================
Files 1273 1273
Lines 31342 31338 -4
Branches 3213 3213
=======================================
Hits 14414 14414
+ Misses 16079 16075 -4
Partials 849 849 ☔ View full report in Codecov by Sentry. |
|
owencraston
left a comment
There was a problem hiding this comment.
why not remove the selectedAddress: accountsController.getSelectedAccount().address, on line 521 if we are going to stick to using the preferences controller as the source of truth?
|
|
owencraston
left a comment
There was a problem hiding this comment.
Code looks good to me and I did a QA pass and it also looked good.
Test paths
- on version 7.19.0 QA build...
- imported an account via SRP with eth
- imported an account via private key with eth and tokens (orangefox.eth)
- imported tokens on mainnet
- added custom networks (polygon, BNB)
- imported available tokens
- switched networks
- added a new account
- updated to a QA build of this branch
- all accounts were present with the correct names
- all mainnet balances were correct
- all mainnet tokens were present with the correct balances
- all custom network balances were correct
- all custom neto\work tokens and token balances were present and correct



Description
The variable
newlySelectedInternalAccount.address, that was being returned by theAccountsController:selectedAccountChangeevent was on a lowercase format. We were duplicating the accounts, so one account was checksummed and another not, which was making the tokens be on storage but not showing because the new selected account was not with tokens imported.This is a how the data storage was:
This is how it is now:
Related issues
Fixes: #9122
Manual testing steps
Screenshots/Recordings
Upgrade path recording:
Uploading Screen Recording 2024-04-05 at 13.14.41.mov…
Before
RPReplay_Final1712163751.MP4
After
screen-20240408-200805.mp4
Pre-merge author checklist
Pre-merge reviewer checklist