-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> This PR addresses the issue of duplicate accounts showing up in the wallet. This bug was introduced when [the accounts controller was integrated](#8759) but was only visible to users in [this PR](#9733) when we started rendering account information in the accounts list. The is that when we ran migration `036.ts`, we simply added the all of the identities from the preferences controller into the AccountsController. However the accounts controller also consumes addresses from the KeyringController and those addresses are in lowercase. The result would be two accounts with the same address, one in checksum format and one in lowercase format. This would result in duplicates when rendering the UI. This PR addresses this issue in two ways... 1. for users who are using <= v7.19.0 - I have patched migration 36 to ensure that the addresses that are added are lowercase. 2. For users who have are using version >= 7.20.0 and are already effected by this bug - I have created a new migration to deduplicate the accounts in the accounts controller and ensure that we are only storing lowercase addresses in state. Fixes: #9823 - [Current branch](https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/c68d80ea-dbaa-4e81-9018-fe9757cab397) - [7.18.0](https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/011ac0b3-b1d8-4e53-9595-ea0f739d4d10) - [7.24.0](https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/a5c54c50-8382-45ad-b203-687b66273c4e) 1. Install [7.18.0](https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/011ac0b3-b1d8-4e53-9595-ea0f739d4d10) and import a wallet with multiple addresses already 2. Install [7.24.0](https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/a5c54c50-8382-45ad-b203-687b66273c4e) and upgrade app. 3. EXPECTED: You should see duplicate accounts when you open the accounts list. If you had 5 accounts previously there will be should now be 10. 4. Install [the current branch QA build](https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/c68d80ea-dbaa-4e81-9018-fe9757cab397) and upgrade. 5. EXPECT: The duplicate accounts should be removed (back to 5 accounts from 10) 6. EXPECT: The previously selected address should still be selected 7. EXPECT: The account names should be in tact and in chronological order if they are the default account name. this occurs for users who have not upgraded from 7.19.0 yet 1. Install [7.18.0](https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/011ac0b3-b1d8-4e53-9595-ea0f739d4d10) and import a wallet with multiple addresses already 2. Install [the current branch QA build](https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/c68d80ea-dbaa-4e81-9018-fe9757cab397) and upgrade. 3. EXPECT: All of the account should appear in the accounts list without duplicates 4. EXPECT: The previously selected address should be the same 5. EXPECT: The account names should be the same <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> 7.18.0 <img src="https://github.com/MetaMask/metamask-mobile/assets/22918444/3ee9b1f3-f042-414b-9ce4-82cad7d791cf" width="200" height="400"> After Upgrading to 7.24.0 <img src="https://github.com/MetaMask/metamask-mobile/assets/22918444/47b5ff3d-d2d0-4373-b8a0-ae0007b19b7b" width="200" height="400"> Upgrading to this branch <img src="https://github.com/MetaMask/metamask-mobile/assets/22918444/9ed8d80a-ef3c-40a6-9152-e661a1ecdd25" width="200" height="400"> - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
- Loading branch information
1 parent
b1de3ab
commit 6097d75
Showing
6 changed files
with
743 additions
and
70 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.