-
-
Notifications
You must be signed in to change notification settings - Fork 227
fix: discard duplicate accounts on unlock #5775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
956e6bf
to
1341545
Compare
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
524f070
to
b863dd5
Compare
Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net>
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. As discussed internally, this could cause some issues with the Snap keyring if this one gets "skipped as unsupported".
But it shouldn't be possible to add an account with a duplicated address anyway, we are checking this on the Snap keyring itself:
await controller.submitPassword(password); | ||
|
||
expect(controller.state.keyrings).toHaveLength(1); // Second keyring will be skipped as "unsupported". | ||
expect(unlockListener).toHaveBeenCalledTimes(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nit: I saw we were doing this in another test, but this might redundant:
expect(unlockListener).toHaveBeenCalledTimes(1); | |
expect(controller.state.isUnlocked).toBe(true); | |
expect(unlockListener).toHaveBeenCalledTimes(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
<!-- 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. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> Updating `@metamask/keyring-controller` to `^22.0.0`: ```markdown ## [22.0.0] ### Changed - **BREAKING** `keyringsMetadata` has been removed from the controller state ([#5725](MetaMask/core#5725)) - The metadata is now stored in each keyring object in the `state.keyrings` array. - When updating to this version, we recommend removing the `keyringsMetadata` state and all state referencing a keyring ID with a migration. New metadata will be generated for each keyring automatically after the update. ### Fixed - Keyrings with duplicate accounts are skipped as unsupported on unlock ([#5775](MetaMask/core#5775)) ## [21.0.6] ### Changed - Prevent emitting `:stateChange` from `withKeyring` unnecessarily ([#5732](MetaMask/core#5732)) ``` and `@metamask/accounts-controller` to `^29.0.0`: ```markdown ## [29.0.0] ### Changed - **BREAKING:** bump `@metamask/keyring-controller` peer dependency to `^22.0.0` ([#5802](MetaMask/core#5802)) ## [28.0.0] ### Added - Add new `setAccountNameAndSelectAccount` action ([#5714](MetaMask/core#5714)) - Add `entropySource` and `derivationPath` to EVM HD account options ([#5618](MetaMask/core#5618)) ### Changed - **BREAKING:** Bump `@metamask/snaps-controllers` peer dependency from `^9.19.0` to `^11.0.0` ([#5639](MetaMask/core#5639)) - **BREAKING:** Bump `@metamask/providers` peer dependency from `^18.1.0` to `^21.0.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/base-controller` from `^8.0.0` to `^8.0.1` ([#5722](MetaMask/core#5722)) - Bump `@metamask/snaps-sdk` from `^6.17.1` to `^6.22.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/snaps-utils` from `^8.10.0` to `^9.2.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/eth-snap-keyring` from `^12.0.0` to `^12.1.1` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-api` from `^17.2.0` to `^17.4.0` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-internal-api` from `^6.0.0` to `^6.0.1` ([#5565](MetaMask/core#5565)) ### Fixed - Do not fire events during `update` blocks ([#5555](MetaMask/core#5555)) - Prevent unnecessary state updates when updating `InternalAccount.metadata.snap` ([#5735](MetaMask/core#5735)) ``` [](https://codespaces.new/MetaMask/metamask-extension/pull/32621?quickstart=1) ## **Related issues** Fixes: #32935 ## **Manual testing steps** ### 1. Add duplicate to the wallet state 1.1. Switch to the `v11.7.3` branch, build locally, and install the extension from `chrome://extensions` 1.2. Onboard with an SRP of which we know the second account (`child guilt hollow arrive average popular nasty soon summer like scheme diary pill country rapid`) 1.3. Import an account that is part of the mnemonic ( `0x80842b7e3cfb1118e86a427cdec418e3b4179ef5bbbfd71c02a76349831c8a8b` which is the account at index 2 of the above SRP) 1.4. Add a new account on the main HD 1.5. Switch to `Version-v12.17.1` branch, and refresh the extension in `chrome://extensions` 1.6. Unlock the wallet, you should see duplicates in your accounts list and you won't be able to add new accounts ### 2. Test the fix 2.1. Switch to this branch, build locally, and refresh the extension in `chrome://extensions` 2.2 Unlock the wallet, you shouldn't see duplicate accounts anymore, and you should be able to add new accounts ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] 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. --------- Co-authored-by: Mark Stacey <mark.stacey@consensys.net>
<!-- 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. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> Updating `@metamask/keyring-controller` to `^22.0.0`: ```markdown ## [22.0.0] ### Changed - **BREAKING** `keyringsMetadata` has been removed from the controller state ([#5725](MetaMask/core#5725)) - The metadata is now stored in each keyring object in the `state.keyrings` array. - When updating to this version, we recommend removing the `keyringsMetadata` state and all state referencing a keyring ID with a migration. New metadata will be generated for each keyring automatically after the update. ### Fixed - Keyrings with duplicate accounts are skipped as unsupported on unlock ([#5775](MetaMask/core#5775)) ## [21.0.6] ### Changed - Prevent emitting `:stateChange` from `withKeyring` unnecessarily ([#5732](MetaMask/core#5732)) ``` and `@metamask/accounts-controller` to `^29.0.0`: ```markdown ## [29.0.0] ### Changed - **BREAKING:** bump `@metamask/keyring-controller` peer dependency to `^22.0.0` ([#5802](MetaMask/core#5802)) ## [28.0.0] ### Added - Add new `setAccountNameAndSelectAccount` action ([#5714](MetaMask/core#5714)) - Add `entropySource` and `derivationPath` to EVM HD account options ([#5618](MetaMask/core#5618)) ### Changed - **BREAKING:** Bump `@metamask/snaps-controllers` peer dependency from `^9.19.0` to `^11.0.0` ([#5639](MetaMask/core#5639)) - **BREAKING:** Bump `@metamask/providers` peer dependency from `^18.1.0` to `^21.0.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/base-controller` from `^8.0.0` to `^8.0.1` ([#5722](MetaMask/core#5722)) - Bump `@metamask/snaps-sdk` from `^6.17.1` to `^6.22.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/snaps-utils` from `^8.10.0` to `^9.2.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/eth-snap-keyring` from `^12.0.0` to `^12.1.1` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-api` from `^17.2.0` to `^17.4.0` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-internal-api` from `^6.0.0` to `^6.0.1` ([#5565](MetaMask/core#5565)) ### Fixed - Do not fire events during `update` blocks ([#5555](MetaMask/core#5555)) - Prevent unnecessary state updates when updating `InternalAccount.metadata.snap` ([#5735](MetaMask/core#5735)) ``` [](https://codespaces.new/MetaMask/metamask-extension/pull/32621?quickstart=1) ## **Related issues** Fixes: #32935 ## **Manual testing steps** ### 1. Add duplicate to the wallet state 1.1. Switch to the `v11.7.3` branch, build locally, and install the extension from `chrome://extensions` 1.2. Onboard with an SRP of which we know the second account (`child guilt hollow arrive average popular nasty soon summer like scheme diary pill country rapid`) 1.3. Import an account that is part of the mnemonic ( `0x80842b7e3cfb1118e86a427cdec418e3b4179ef5bbbfd71c02a76349831c8a8b` which is the account at index 2 of the above SRP) 1.4. Add a new account on the main HD 1.5. Switch to `Version-v12.17.1` branch, and refresh the extension in `chrome://extensions` 1.6. Unlock the wallet, you should see duplicates in your accounts list and you won't be able to add new accounts ### 2. Test the fix 2.1. Switch to this branch, build locally, and refresh the extension in `chrome://extensions` 2.2 Unlock the wallet, you shouldn't see duplicate accounts anymore, and you should be able to add new accounts ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] 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. --------- Co-authored-by: Mark Stacey <mark.stacey@consensys.net>
<!-- 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. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> Updating `@metamask/keyring-controller` to `^22.0.0`: ```markdown ## [22.0.0] ### Changed - **BREAKING** `keyringsMetadata` has been removed from the controller state ([#5725](MetaMask/core#5725)) - The metadata is now stored in each keyring object in the `state.keyrings` array. - When updating to this version, we recommend removing the `keyringsMetadata` state and all state referencing a keyring ID with a migration. New metadata will be generated for each keyring automatically after the update. ### Fixed - Keyrings with duplicate accounts are skipped as unsupported on unlock ([#5775](MetaMask/core#5775)) ## [21.0.6] ### Changed - Prevent emitting `:stateChange` from `withKeyring` unnecessarily ([#5732](MetaMask/core#5732)) ``` and `@metamask/accounts-controller` to `^29.0.0`: ```markdown ## [29.0.0] ### Changed - **BREAKING:** bump `@metamask/keyring-controller` peer dependency to `^22.0.0` ([#5802](MetaMask/core#5802)) ## [28.0.0] ### Added - Add new `setAccountNameAndSelectAccount` action ([#5714](MetaMask/core#5714)) - Add `entropySource` and `derivationPath` to EVM HD account options ([#5618](MetaMask/core#5618)) ### Changed - **BREAKING:** Bump `@metamask/snaps-controllers` peer dependency from `^9.19.0` to `^11.0.0` ([#5639](MetaMask/core#5639)) - **BREAKING:** Bump `@metamask/providers` peer dependency from `^18.1.0` to `^21.0.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/base-controller` from `^8.0.0` to `^8.0.1` ([#5722](MetaMask/core#5722)) - Bump `@metamask/snaps-sdk` from `^6.17.1` to `^6.22.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/snaps-utils` from `^8.10.0` to `^9.2.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/eth-snap-keyring` from `^12.0.0` to `^12.1.1` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-api` from `^17.2.0` to `^17.4.0` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-internal-api` from `^6.0.0` to `^6.0.1` ([#5565](MetaMask/core#5565)) ### Fixed - Do not fire events during `update` blocks ([#5555](MetaMask/core#5555)) - Prevent unnecessary state updates when updating `InternalAccount.metadata.snap` ([#5735](MetaMask/core#5735)) ``` [](https://codespaces.new/MetaMask/metamask-extension/pull/32621?quickstart=1) ## **Related issues** Fixes: #32935 ## **Manual testing steps** ### 1. Add duplicate to the wallet state 1.1. Switch to the `v11.7.3` branch, build locally, and install the extension from `chrome://extensions` 1.2. Onboard with an SRP of which we know the second account (`child guilt hollow arrive average popular nasty soon summer like scheme diary pill country rapid`) 1.3. Import an account that is part of the mnemonic ( `0x80842b7e3cfb1118e86a427cdec418e3b4179ef5bbbfd71c02a76349831c8a8b` which is the account at index 2 of the above SRP) 1.4. Add a new account on the main HD 1.5. Switch to `Version-v12.17.1` branch, and refresh the extension in `chrome://extensions` 1.6. Unlock the wallet, you should see duplicates in your accounts list and you won't be able to add new accounts ### 2. Test the fix 2.1. Switch to this branch, build locally, and refresh the extension in `chrome://extensions` 2.2 Unlock the wallet, you shouldn't see duplicate accounts anymore, and you should be able to add new accounts ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] 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. --------- Co-authored-by: Mark Stacey <mark.stacey@consensys.net>
<!-- 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. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> Updating `@metamask/keyring-controller` to `^22.0.0`: ```markdown ## [22.0.0] ### Changed - **BREAKING** `keyringsMetadata` has been removed from the controller state ([#5725](MetaMask/core#5725)) - The metadata is now stored in each keyring object in the `state.keyrings` array. - When updating to this version, we recommend removing the `keyringsMetadata` state and all state referencing a keyring ID with a migration. New metadata will be generated for each keyring automatically after the update. ### Fixed - Keyrings with duplicate accounts are skipped as unsupported on unlock ([#5775](MetaMask/core#5775)) ## [21.0.6] ### Changed - Prevent emitting `:stateChange` from `withKeyring` unnecessarily ([#5732](MetaMask/core#5732)) ``` and `@metamask/accounts-controller` to `^29.0.0`: ```markdown ## [29.0.0] ### Changed - **BREAKING:** bump `@metamask/keyring-controller` peer dependency to `^22.0.0` ([#5802](MetaMask/core#5802)) ## [28.0.0] ### Added - Add new `setAccountNameAndSelectAccount` action ([#5714](MetaMask/core#5714)) - Add `entropySource` and `derivationPath` to EVM HD account options ([#5618](MetaMask/core#5618)) ### Changed - **BREAKING:** Bump `@metamask/snaps-controllers` peer dependency from `^9.19.0` to `^11.0.0` ([#5639](MetaMask/core#5639)) - **BREAKING:** Bump `@metamask/providers` peer dependency from `^18.1.0` to `^21.0.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/base-controller` from `^8.0.0` to `^8.0.1` ([#5722](MetaMask/core#5722)) - Bump `@metamask/snaps-sdk` from `^6.17.1` to `^6.22.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/snaps-utils` from `^8.10.0` to `^9.2.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/eth-snap-keyring` from `^12.0.0` to `^12.1.1` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-api` from `^17.2.0` to `^17.4.0` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-internal-api` from `^6.0.0` to `^6.0.1` ([#5565](MetaMask/core#5565)) ### Fixed - Do not fire events during `update` blocks ([#5555](MetaMask/core#5555)) - Prevent unnecessary state updates when updating `InternalAccount.metadata.snap` ([#5735](MetaMask/core#5735)) ``` [](https://codespaces.new/MetaMask/metamask-extension/pull/32621?quickstart=1) ## **Related issues** Fixes: #32935 ## **Manual testing steps** ### 1. Add duplicate to the wallet state 1.1. Switch to the `v11.7.3` branch, build locally, and install the extension from `chrome://extensions` 1.2. Onboard with an SRP of which we know the second account (`child guilt hollow arrive average popular nasty soon summer like scheme diary pill country rapid`) 1.3. Import an account that is part of the mnemonic ( `0x80842b7e3cfb1118e86a427cdec418e3b4179ef5bbbfd71c02a76349831c8a8b` which is the account at index 2 of the above SRP) 1.4. Add a new account on the main HD 1.5. Switch to `Version-v12.17.1` branch, and refresh the extension in `chrome://extensions` 1.6. Unlock the wallet, you should see duplicates in your accounts list and you won't be able to add new accounts ### 2. Test the fix 2.1. Switch to this branch, build locally, and refresh the extension in `chrome://extensions` 2.2 Unlock the wallet, you shouldn't see duplicate accounts anymore, and you should be able to add new accounts ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] 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. --------- Co-authored-by: Mark Stacey <mark.stacey@consensys.net>
<!-- 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. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> Updating `@metamask/keyring-controller` to `^22.0.0`: ```markdown ## [22.0.0] ### Changed - **BREAKING** `keyringsMetadata` has been removed from the controller state ([#5725](MetaMask/core#5725)) - The metadata is now stored in each keyring object in the `state.keyrings` array. - When updating to this version, we recommend removing the `keyringsMetadata` state and all state referencing a keyring ID with a migration. New metadata will be generated for each keyring automatically after the update. ### Fixed - Keyrings with duplicate accounts are skipped as unsupported on unlock ([#5775](MetaMask/core#5775)) ## [21.0.6] ### Changed - Prevent emitting `:stateChange` from `withKeyring` unnecessarily ([#5732](MetaMask/core#5732)) ``` and `@metamask/accounts-controller` to `^29.0.0`: ```markdown ## [29.0.0] ### Changed - **BREAKING:** bump `@metamask/keyring-controller` peer dependency to `^22.0.0` ([#5802](MetaMask/core#5802)) ## [28.0.0] ### Added - Add new `setAccountNameAndSelectAccount` action ([#5714](MetaMask/core#5714)) - Add `entropySource` and `derivationPath` to EVM HD account options ([#5618](MetaMask/core#5618)) ### Changed - **BREAKING:** Bump `@metamask/snaps-controllers` peer dependency from `^9.19.0` to `^11.0.0` ([#5639](MetaMask/core#5639)) - **BREAKING:** Bump `@metamask/providers` peer dependency from `^18.1.0` to `^21.0.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/base-controller` from `^8.0.0` to `^8.0.1` ([#5722](MetaMask/core#5722)) - Bump `@metamask/snaps-sdk` from `^6.17.1` to `^6.22.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/snaps-utils` from `^8.10.0` to `^9.2.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/eth-snap-keyring` from `^12.0.0` to `^12.1.1` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-api` from `^17.2.0` to `^17.4.0` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-internal-api` from `^6.0.0` to `^6.0.1` ([#5565](MetaMask/core#5565)) ### Fixed - Do not fire events during `update` blocks ([#5555](MetaMask/core#5555)) - Prevent unnecessary state updates when updating `InternalAccount.metadata.snap` ([#5735](MetaMask/core#5735)) ``` [](https://codespaces.new/MetaMask/metamask-extension/pull/32621?quickstart=1) ## **Related issues** Fixes: #32935 ## **Manual testing steps** ### 1. Add duplicate to the wallet state 1.1. Switch to the `v11.7.3` branch, build locally, and install the extension from `chrome://extensions` 1.2. Onboard with an SRP of which we know the second account (`child guilt hollow arrive average popular nasty soon summer like scheme diary pill country rapid`) 1.3. Import an account that is part of the mnemonic ( `0x80842b7e3cfb1118e86a427cdec418e3b4179ef5bbbfd71c02a76349831c8a8b` which is the account at index 2 of the above SRP) 1.4. Add a new account on the main HD 1.5. Switch to `Version-v12.17.1` branch, and refresh the extension in `chrome://extensions` 1.6. Unlock the wallet, you should see duplicates in your accounts list and you won't be able to add new accounts ### 2. Test the fix 2.1. Switch to this branch, build locally, and refresh the extension in `chrome://extensions` 2.2 Unlock the wallet, you shouldn't see duplicate accounts anymore, and you should be able to add new accounts ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] 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. --------- Co-authored-by: Mark Stacey <mark.stacey@consensys.net>
<!-- 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. --> <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> Updating `@metamask/keyring-controller` to `^22.0.0`: ```markdown - **BREAKING** `keyringsMetadata` has been removed from the controller state ([#5725](MetaMask/core#5725)) - The metadata is now stored in each keyring object in the `state.keyrings` array. - When updating to this version, we recommend removing the `keyringsMetadata` state and all state referencing a keyring ID with a migration. New metadata will be generated for each keyring automatically after the update. - Keyrings with duplicate accounts are skipped as unsupported on unlock ([#5775](MetaMask/core#5775)) - Prevent emitting `:stateChange` from `withKeyring` unnecessarily ([#5732](MetaMask/core#5732)) ``` and `@metamask/accounts-controller` to `^29.0.0`: ```markdown - **BREAKING:** bump `@metamask/keyring-controller` peer dependency to `^22.0.0` ([#5802](MetaMask/core#5802)) - Add new `setAccountNameAndSelectAccount` action ([#5714](MetaMask/core#5714)) - Add `entropySource` and `derivationPath` to EVM HD account options ([#5618](MetaMask/core#5618)) - **BREAKING:** Bump `@metamask/snaps-controllers` peer dependency from `^9.19.0` to `^11.0.0` ([#5639](MetaMask/core#5639)) - **BREAKING:** Bump `@metamask/providers` peer dependency from `^18.1.0` to `^21.0.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/base-controller` from `^8.0.0` to `^8.0.1` ([#5722](MetaMask/core#5722)) - Bump `@metamask/snaps-sdk` from `^6.17.1` to `^6.22.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/snaps-utils` from `^8.10.0` to `^9.2.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/eth-snap-keyring` from `^12.0.0` to `^12.1.1` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-api` from `^17.2.0` to `^17.4.0` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-internal-api` from `^6.0.0` to `^6.0.1` ([#5565](MetaMask/core#5565)) - Do not fire events during `update` blocks ([#5555](MetaMask/core#5555)) - Prevent unnecessary state updates when updating `InternalAccount.metadata.snap` ([#5735](MetaMask/core#5735)) ``` [](https://codespaces.new/MetaMask/metamask-extension/pull/32621?quickstart=1) Fixes: #32935 1.1. Switch to the `v11.7.3` branch, build locally, and install the extension from `chrome://extensions` 1.2. Onboard with an SRP of which we know the second account (`child guilt hollow arrive average popular nasty soon summer like scheme diary pill country rapid`) 1.3. Import an account that is part of the mnemonic ( `0x80842b7e3cfb1118e86a427cdec418e3b4179ef5bbbfd71c02a76349831c8a8b` which is the account at index 2 of the above SRP) 1.4. Add a new account on the main HD 1.5. Switch to `Version-v12.17.1` branch, and refresh the extension in `chrome://extensions` 1.6. Unlock the wallet, you should see duplicates in your accounts list and you won't be able to add new accounts 2.1. Switch to this branch, build locally, and refresh the extension in `chrome://extensions` 2.2 Unlock the wallet, you shouldn't see duplicate accounts anymore, and you should be able to add new accounts <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> <!-- [screenshots/recordings] --> <!-- [screenshots/recordings] --> - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [ ] 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. --------- Co-authored-by: Mark Stacey <mark.stacey@consensys.net>
<!-- 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. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> Updating `@metamask/keyring-controller` to `^22.0.0`: ```markdown ## [22.0.0] ### Changed - **BREAKING** `keyringsMetadata` has been removed from the controller state ([#5725](MetaMask/core#5725)) - The metadata is now stored in each keyring object in the `state.keyrings` array. - When updating to this version, we recommend removing the `keyringsMetadata` state and all state referencing a keyring ID with a migration. New metadata will be generated for each keyring automatically after the update. ### Fixed - Keyrings with duplicate accounts are skipped as unsupported on unlock ([#5775](MetaMask/core#5775)) ## [21.0.6] ### Changed - Prevent emitting `:stateChange` from `withKeyring` unnecessarily ([#5732](MetaMask/core#5732)) ``` and `@metamask/accounts-controller` to `^29.0.0`: ```markdown ## [29.0.0] ### Changed - **BREAKING:** bump `@metamask/keyring-controller` peer dependency to `^22.0.0` ([#5802](MetaMask/core#5802)) ## [28.0.0] ### Added - Add new `setAccountNameAndSelectAccount` action ([#5714](MetaMask/core#5714)) - Add `entropySource` and `derivationPath` to EVM HD account options ([#5618](MetaMask/core#5618)) ### Changed - **BREAKING:** Bump `@metamask/snaps-controllers` peer dependency from `^9.19.0` to `^11.0.0` ([#5639](MetaMask/core#5639)) - **BREAKING:** Bump `@metamask/providers` peer dependency from `^18.1.0` to `^21.0.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/base-controller` from `^8.0.0` to `^8.0.1` ([#5722](MetaMask/core#5722)) - Bump `@metamask/snaps-sdk` from `^6.17.1` to `^6.22.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/snaps-utils` from `^8.10.0` to `^9.2.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/eth-snap-keyring` from `^12.0.0` to `^12.1.1` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-api` from `^17.2.0` to `^17.4.0` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-internal-api` from `^6.0.0` to `^6.0.1` ([#5565](MetaMask/core#5565)) ### Fixed - Do not fire events during `update` blocks ([#5555](MetaMask/core#5555)) - Prevent unnecessary state updates when updating `InternalAccount.metadata.snap` ([#5735](MetaMask/core#5735)) ``` [](https://codespaces.new/MetaMask/metamask-extension/pull/32621?quickstart=1) ## **Related issues** Fixes: #32935 ## **Manual testing steps** ### 1. Add duplicate to the wallet state 1.1. Switch to the `v11.7.3` branch, build locally, and install the extension from `chrome://extensions` 1.2. Onboard with an SRP of which we know the second account (`child guilt hollow arrive average popular nasty soon summer like scheme diary pill country rapid`) 1.3. Import an account that is part of the mnemonic ( `0x80842b7e3cfb1118e86a427cdec418e3b4179ef5bbbfd71c02a76349831c8a8b` which is the account at index 2 of the above SRP) 1.4. Add a new account on the main HD 1.5. Switch to `Version-v12.17.1` branch, and refresh the extension in `chrome://extensions` 1.6. Unlock the wallet, you should see duplicates in your accounts list and you won't be able to add new accounts ### 2. Test the fix 2.1. Switch to this branch, build locally, and refresh the extension in `chrome://extensions` 2.2 Unlock the wallet, you shouldn't see duplicate accounts anymore, and you should be able to add new accounts ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] 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. --------- Co-authored-by: Mark Stacey <mark.stacey@consensys.net>
<!-- 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. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> Updating `@metamask/keyring-controller` to `^22.0.0`: ```markdown ## [22.0.0] ### Changed - **BREAKING** `keyringsMetadata` has been removed from the controller state ([#5725](MetaMask/core#5725)) - The metadata is now stored in each keyring object in the `state.keyrings` array. - When updating to this version, we recommend removing the `keyringsMetadata` state and all state referencing a keyring ID with a migration. New metadata will be generated for each keyring automatically after the update. ### Fixed - Keyrings with duplicate accounts are skipped as unsupported on unlock ([#5775](MetaMask/core#5775)) ## [21.0.6] ### Changed - Prevent emitting `:stateChange` from `withKeyring` unnecessarily ([#5732](MetaMask/core#5732)) ``` and `@metamask/accounts-controller` to `^29.0.0`: ```markdown ## [29.0.0] ### Changed - **BREAKING:** bump `@metamask/keyring-controller` peer dependency to `^22.0.0` ([#5802](MetaMask/core#5802)) ## [28.0.0] ### Added - Add new `setAccountNameAndSelectAccount` action ([#5714](MetaMask/core#5714)) - Add `entropySource` and `derivationPath` to EVM HD account options ([#5618](MetaMask/core#5618)) ### Changed - **BREAKING:** Bump `@metamask/snaps-controllers` peer dependency from `^9.19.0` to `^11.0.0` ([#5639](MetaMask/core#5639)) - **BREAKING:** Bump `@metamask/providers` peer dependency from `^18.1.0` to `^21.0.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/base-controller` from `^8.0.0` to `^8.0.1` ([#5722](MetaMask/core#5722)) - Bump `@metamask/snaps-sdk` from `^6.17.1` to `^6.22.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/snaps-utils` from `^8.10.0` to `^9.2.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/eth-snap-keyring` from `^12.0.0` to `^12.1.1` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-api` from `^17.2.0` to `^17.4.0` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-internal-api` from `^6.0.0` to `^6.0.1` ([#5565](MetaMask/core#5565)) ### Fixed - Do not fire events during `update` blocks ([#5555](MetaMask/core#5555)) - Prevent unnecessary state updates when updating `InternalAccount.metadata.snap` ([#5735](MetaMask/core#5735)) ``` [](https://codespaces.new/MetaMask/metamask-extension/pull/32621?quickstart=1) ## **Related issues** Fixes: #32935 ## **Manual testing steps** ### 1. Add duplicate to the wallet state 1.1. Switch to the `v11.7.3` branch, build locally, and install the extension from `chrome://extensions` 1.2. Onboard with an SRP of which we know the second account (`child guilt hollow arrive average popular nasty soon summer like scheme diary pill country rapid`) 1.3. Import an account that is part of the mnemonic ( `0x80842b7e3cfb1118e86a427cdec418e3b4179ef5bbbfd71c02a76349831c8a8b` which is the account at index 2 of the above SRP) 1.4. Add a new account on the main HD 1.5. Switch to `Version-v12.17.1` branch, and refresh the extension in `chrome://extensions` 1.6. Unlock the wallet, you should see duplicates in your accounts list and you won't be able to add new accounts ### 2. Test the fix 2.1. Switch to this branch, build locally, and refresh the extension in `chrome://extensions` 2.2 Unlock the wallet, you shouldn't see duplicate accounts anymore, and you should be able to add new accounts ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] 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. --------- Co-authored-by: Mark Stacey <mark.stacey@consensys.net>
<!-- 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. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> Updating `@metamask/keyring-controller` to `^22.0.0`: ```markdown ## [22.0.0] ### Changed - **BREAKING** `keyringsMetadata` has been removed from the controller state ([#5725](MetaMask/core#5725)) - The metadata is now stored in each keyring object in the `state.keyrings` array. - When updating to this version, we recommend removing the `keyringsMetadata` state and all state referencing a keyring ID with a migration. New metadata will be generated for each keyring automatically after the update. ### Fixed - Keyrings with duplicate accounts are skipped as unsupported on unlock ([#5775](MetaMask/core#5775)) ## [21.0.6] ### Changed - Prevent emitting `:stateChange` from `withKeyring` unnecessarily ([#5732](MetaMask/core#5732)) ``` and `@metamask/accounts-controller` to `^29.0.0`: ```markdown ## [29.0.0] ### Changed - **BREAKING:** bump `@metamask/keyring-controller` peer dependency to `^22.0.0` ([#5802](MetaMask/core#5802)) ## [28.0.0] ### Added - Add new `setAccountNameAndSelectAccount` action ([#5714](MetaMask/core#5714)) - Add `entropySource` and `derivationPath` to EVM HD account options ([#5618](MetaMask/core#5618)) ### Changed - **BREAKING:** Bump `@metamask/snaps-controllers` peer dependency from `^9.19.0` to `^11.0.0` ([#5639](MetaMask/core#5639)) - **BREAKING:** Bump `@metamask/providers` peer dependency from `^18.1.0` to `^21.0.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/base-controller` from `^8.0.0` to `^8.0.1` ([#5722](MetaMask/core#5722)) - Bump `@metamask/snaps-sdk` from `^6.17.1` to `^6.22.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/snaps-utils` from `^8.10.0` to `^9.2.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/eth-snap-keyring` from `^12.0.0` to `^12.1.1` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-api` from `^17.2.0` to `^17.4.0` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-internal-api` from `^6.0.0` to `^6.0.1` ([#5565](MetaMask/core#5565)) ### Fixed - Do not fire events during `update` blocks ([#5555](MetaMask/core#5555)) - Prevent unnecessary state updates when updating `InternalAccount.metadata.snap` ([#5735](MetaMask/core#5735)) ``` [](https://codespaces.new/MetaMask/metamask-extension/pull/32621?quickstart=1) ## **Related issues** Fixes: #32935 ## **Manual testing steps** ### 1. Add duplicate to the wallet state 1.1. Switch to the `v11.7.3` branch, build locally, and install the extension from `chrome://extensions` 1.2. Onboard with an SRP of which we know the second account (`child guilt hollow arrive average popular nasty soon summer like scheme diary pill country rapid`) 1.3. Import an account that is part of the mnemonic ( `0x80842b7e3cfb1118e86a427cdec418e3b4179ef5bbbfd71c02a76349831c8a8b` which is the account at index 2 of the above SRP) 1.4. Add a new account on the main HD 1.5. Switch to `Version-v12.17.1` branch, and refresh the extension in `chrome://extensions` 1.6. Unlock the wallet, you should see duplicates in your accounts list and you won't be able to add new accounts ### 2. Test the fix 2.1. Switch to this branch, build locally, and refresh the extension in `chrome://extensions` 2.2 Unlock the wallet, you shouldn't see duplicate accounts anymore, and you should be able to add new accounts ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] 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. --------- Co-authored-by: Mark Stacey <mark.stacey@consensys.net>
<!-- 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. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> Updating `@metamask/keyring-controller` to `^22.0.0`: ```markdown ## [22.0.0] ### Changed - **BREAKING** `keyringsMetadata` has been removed from the controller state ([#5725](MetaMask/core#5725)) - The metadata is now stored in each keyring object in the `state.keyrings` array. - When updating to this version, we recommend removing the `keyringsMetadata` state and all state referencing a keyring ID with a migration. New metadata will be generated for each keyring automatically after the update. ### Fixed - Keyrings with duplicate accounts are skipped as unsupported on unlock ([#5775](MetaMask/core#5775)) ## [21.0.6] ### Changed - Prevent emitting `:stateChange` from `withKeyring` unnecessarily ([#5732](MetaMask/core#5732)) ``` and `@metamask/accounts-controller` to `^29.0.0`: ```markdown ## [29.0.0] ### Changed - **BREAKING:** bump `@metamask/keyring-controller` peer dependency to `^22.0.0` ([#5802](MetaMask/core#5802)) ## [28.0.0] ### Added - Add new `setAccountNameAndSelectAccount` action ([#5714](MetaMask/core#5714)) - Add `entropySource` and `derivationPath` to EVM HD account options ([#5618](MetaMask/core#5618)) ### Changed - **BREAKING:** Bump `@metamask/snaps-controllers` peer dependency from `^9.19.0` to `^11.0.0` ([#5639](MetaMask/core#5639)) - **BREAKING:** Bump `@metamask/providers` peer dependency from `^18.1.0` to `^21.0.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/base-controller` from `^8.0.0` to `^8.0.1` ([#5722](MetaMask/core#5722)) - Bump `@metamask/snaps-sdk` from `^6.17.1` to `^6.22.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/snaps-utils` from `^8.10.0` to `^9.2.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/eth-snap-keyring` from `^12.0.0` to `^12.1.1` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-api` from `^17.2.0` to `^17.4.0` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-internal-api` from `^6.0.0` to `^6.0.1` ([#5565](MetaMask/core#5565)) ### Fixed - Do not fire events during `update` blocks ([#5555](MetaMask/core#5555)) - Prevent unnecessary state updates when updating `InternalAccount.metadata.snap` ([#5735](MetaMask/core#5735)) ``` [](https://codespaces.new/MetaMask/metamask-extension/pull/32621?quickstart=1) ## **Related issues** Fixes: #32935 ## **Manual testing steps** ### 1. Add duplicate to the wallet state 1.1. Switch to the `v11.7.3` branch, build locally, and install the extension from `chrome://extensions` 1.2. Onboard with an SRP of which we know the second account (`child guilt hollow arrive average popular nasty soon summer like scheme diary pill country rapid`) 1.3. Import an account that is part of the mnemonic ( `0x80842b7e3cfb1118e86a427cdec418e3b4179ef5bbbfd71c02a76349831c8a8b` which is the account at index 2 of the above SRP) 1.4. Add a new account on the main HD 1.5. Switch to `Version-v12.17.1` branch, and refresh the extension in `chrome://extensions` 1.6. Unlock the wallet, you should see duplicates in your accounts list and you won't be able to add new accounts ### 2. Test the fix 2.1. Switch to this branch, build locally, and refresh the extension in `chrome://extensions` 2.2 Unlock the wallet, you shouldn't see duplicate accounts anymore, and you should be able to add new accounts ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] 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. --------- Co-authored-by: Mark Stacey <mark.stacey@consensys.net>
<!-- 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. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> Updating `@metamask/keyring-controller` to `^22.0.0`: ```markdown ## [22.0.0] ### Changed - **BREAKING** `keyringsMetadata` has been removed from the controller state ([#5725](MetaMask/core#5725)) - The metadata is now stored in each keyring object in the `state.keyrings` array. - When updating to this version, we recommend removing the `keyringsMetadata` state and all state referencing a keyring ID with a migration. New metadata will be generated for each keyring automatically after the update. ### Fixed - Keyrings with duplicate accounts are skipped as unsupported on unlock ([#5775](MetaMask/core#5775)) ## [21.0.6] ### Changed - Prevent emitting `:stateChange` from `withKeyring` unnecessarily ([#5732](MetaMask/core#5732)) ``` and `@metamask/accounts-controller` to `^29.0.0`: ```markdown ## [29.0.0] ### Changed - **BREAKING:** bump `@metamask/keyring-controller` peer dependency to `^22.0.0` ([#5802](MetaMask/core#5802)) ## [28.0.0] ### Added - Add new `setAccountNameAndSelectAccount` action ([#5714](MetaMask/core#5714)) - Add `entropySource` and `derivationPath` to EVM HD account options ([#5618](MetaMask/core#5618)) ### Changed - **BREAKING:** Bump `@metamask/snaps-controllers` peer dependency from `^9.19.0` to `^11.0.0` ([#5639](MetaMask/core#5639)) - **BREAKING:** Bump `@metamask/providers` peer dependency from `^18.1.0` to `^21.0.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/base-controller` from `^8.0.0` to `^8.0.1` ([#5722](MetaMask/core#5722)) - Bump `@metamask/snaps-sdk` from `^6.17.1` to `^6.22.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/snaps-utils` from `^8.10.0` to `^9.2.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/eth-snap-keyring` from `^12.0.0` to `^12.1.1` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-api` from `^17.2.0` to `^17.4.0` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-internal-api` from `^6.0.0` to `^6.0.1` ([#5565](MetaMask/core#5565)) ### Fixed - Do not fire events during `update` blocks ([#5555](MetaMask/core#5555)) - Prevent unnecessary state updates when updating `InternalAccount.metadata.snap` ([#5735](MetaMask/core#5735)) ``` [](https://codespaces.new/MetaMask/metamask-extension/pull/32621?quickstart=1) ## **Related issues** Fixes: #32935 ## **Manual testing steps** ### 1. Add duplicate to the wallet state 1.1. Switch to the `v11.7.3` branch, build locally, and install the extension from `chrome://extensions` 1.2. Onboard with an SRP of which we know the second account (`child guilt hollow arrive average popular nasty soon summer like scheme diary pill country rapid`) 1.3. Import an account that is part of the mnemonic ( `0x80842b7e3cfb1118e86a427cdec418e3b4179ef5bbbfd71c02a76349831c8a8b` which is the account at index 2 of the above SRP) 1.4. Add a new account on the main HD 1.5. Switch to `Version-v12.17.1` branch, and refresh the extension in `chrome://extensions` 1.6. Unlock the wallet, you should see duplicates in your accounts list and you won't be able to add new accounts ### 2. Test the fix 2.1. Switch to this branch, build locally, and refresh the extension in `chrome://extensions` 2.2 Unlock the wallet, you shouldn't see duplicate accounts anymore, and you should be able to add new accounts ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] 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. --------- Co-authored-by: Mark Stacey <mark.stacey@consensys.net>
<!-- 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. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> Updating `@metamask/keyring-controller` to `^22.0.0`: ```markdown ## [22.0.0] ### Changed - **BREAKING** `keyringsMetadata` has been removed from the controller state ([#5725](MetaMask/core#5725)) - The metadata is now stored in each keyring object in the `state.keyrings` array. - When updating to this version, we recommend removing the `keyringsMetadata` state and all state referencing a keyring ID with a migration. New metadata will be generated for each keyring automatically after the update. ### Fixed - Keyrings with duplicate accounts are skipped as unsupported on unlock ([#5775](MetaMask/core#5775)) ## [21.0.6] ### Changed - Prevent emitting `:stateChange` from `withKeyring` unnecessarily ([#5732](MetaMask/core#5732)) ``` and `@metamask/accounts-controller` to `^29.0.0`: ```markdown ## [29.0.0] ### Changed - **BREAKING:** bump `@metamask/keyring-controller` peer dependency to `^22.0.0` ([#5802](MetaMask/core#5802)) ## [28.0.0] ### Added - Add new `setAccountNameAndSelectAccount` action ([#5714](MetaMask/core#5714)) - Add `entropySource` and `derivationPath` to EVM HD account options ([#5618](MetaMask/core#5618)) ### Changed - **BREAKING:** Bump `@metamask/snaps-controllers` peer dependency from `^9.19.0` to `^11.0.0` ([#5639](MetaMask/core#5639)) - **BREAKING:** Bump `@metamask/providers` peer dependency from `^18.1.0` to `^21.0.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/base-controller` from `^8.0.0` to `^8.0.1` ([#5722](MetaMask/core#5722)) - Bump `@metamask/snaps-sdk` from `^6.17.1` to `^6.22.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/snaps-utils` from `^8.10.0` to `^9.2.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/eth-snap-keyring` from `^12.0.0` to `^12.1.1` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-api` from `^17.2.0` to `^17.4.0` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-internal-api` from `^6.0.0` to `^6.0.1` ([#5565](MetaMask/core#5565)) ### Fixed - Do not fire events during `update` blocks ([#5555](MetaMask/core#5555)) - Prevent unnecessary state updates when updating `InternalAccount.metadata.snap` ([#5735](MetaMask/core#5735)) ``` [](https://codespaces.new/MetaMask/metamask-extension/pull/32621?quickstart=1) ## **Related issues** Fixes: #32935 ## **Manual testing steps** ### 1. Add duplicate to the wallet state 1.1. Switch to the `v11.7.3` branch, build locally, and install the extension from `chrome://extensions` 1.2. Onboard with an SRP of which we know the second account (`child guilt hollow arrive average popular nasty soon summer like scheme diary pill country rapid`) 1.3. Import an account that is part of the mnemonic ( `0x80842b7e3cfb1118e86a427cdec418e3b4179ef5bbbfd71c02a76349831c8a8b` which is the account at index 2 of the above SRP) 1.4. Add a new account on the main HD 1.5. Switch to `Version-v12.17.1` branch, and refresh the extension in `chrome://extensions` 1.6. Unlock the wallet, you should see duplicates in your accounts list and you won't be able to add new accounts ### 2. Test the fix 2.1. Switch to this branch, build locally, and refresh the extension in `chrome://extensions` 2.2 Unlock the wallet, you shouldn't see duplicate accounts anymore, and you should be able to add new accounts ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] 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. --------- Co-authored-by: Mark Stacey <mark.stacey@consensys.net>
<!-- 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. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> Updating `@metamask/keyring-controller` to `^22.0.0`: ```markdown ## [22.0.0] ### Changed - **BREAKING** `keyringsMetadata` has been removed from the controller state ([#5725](MetaMask/core#5725)) - The metadata is now stored in each keyring object in the `state.keyrings` array. - When updating to this version, we recommend removing the `keyringsMetadata` state and all state referencing a keyring ID with a migration. New metadata will be generated for each keyring automatically after the update. ### Fixed - Keyrings with duplicate accounts are skipped as unsupported on unlock ([#5775](MetaMask/core#5775)) ## [21.0.6] ### Changed - Prevent emitting `:stateChange` from `withKeyring` unnecessarily ([#5732](MetaMask/core#5732)) ``` and `@metamask/accounts-controller` to `^29.0.0`: ```markdown ## [29.0.0] ### Changed - **BREAKING:** bump `@metamask/keyring-controller` peer dependency to `^22.0.0` ([#5802](MetaMask/core#5802)) ## [28.0.0] ### Added - Add new `setAccountNameAndSelectAccount` action ([#5714](MetaMask/core#5714)) - Add `entropySource` and `derivationPath` to EVM HD account options ([#5618](MetaMask/core#5618)) ### Changed - **BREAKING:** Bump `@metamask/snaps-controllers` peer dependency from `^9.19.0` to `^11.0.0` ([#5639](MetaMask/core#5639)) - **BREAKING:** Bump `@metamask/providers` peer dependency from `^18.1.0` to `^21.0.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/base-controller` from `^8.0.0` to `^8.0.1` ([#5722](MetaMask/core#5722)) - Bump `@metamask/snaps-sdk` from `^6.17.1` to `^6.22.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/snaps-utils` from `^8.10.0` to `^9.2.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/eth-snap-keyring` from `^12.0.0` to `^12.1.1` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-api` from `^17.2.0` to `^17.4.0` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-internal-api` from `^6.0.0` to `^6.0.1` ([#5565](MetaMask/core#5565)) ### Fixed - Do not fire events during `update` blocks ([#5555](MetaMask/core#5555)) - Prevent unnecessary state updates when updating `InternalAccount.metadata.snap` ([#5735](MetaMask/core#5735)) ``` [](https://codespaces.new/MetaMask/metamask-extension/pull/32621?quickstart=1) ## **Related issues** Fixes: #32935 ## **Manual testing steps** ### 1. Add duplicate to the wallet state 1.1. Switch to the `v11.7.3` branch, build locally, and install the extension from `chrome://extensions` 1.2. Onboard with an SRP of which we know the second account (`child guilt hollow arrive average popular nasty soon summer like scheme diary pill country rapid`) 1.3. Import an account that is part of the mnemonic ( `0x80842b7e3cfb1118e86a427cdec418e3b4179ef5bbbfd71c02a76349831c8a8b` which is the account at index 2 of the above SRP) 1.4. Add a new account on the main HD 1.5. Switch to `Version-v12.17.1` branch, and refresh the extension in `chrome://extensions` 1.6. Unlock the wallet, you should see duplicates in your accounts list and you won't be able to add new accounts ### 2. Test the fix 2.1. Switch to this branch, build locally, and refresh the extension in `chrome://extensions` 2.2 Unlock the wallet, you shouldn't see duplicate accounts anymore, and you should be able to add new accounts ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] 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. --------- Co-authored-by: Mark Stacey <mark.stacey@consensys.net>
<!-- 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. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> Updating `@metamask/keyring-controller` to `^22.0.0`: ```markdown ## [22.0.0] ### Changed - **BREAKING** `keyringsMetadata` has been removed from the controller state ([#5725](MetaMask/core#5725)) - The metadata is now stored in each keyring object in the `state.keyrings` array. - When updating to this version, we recommend removing the `keyringsMetadata` state and all state referencing a keyring ID with a migration. New metadata will be generated for each keyring automatically after the update. ### Fixed - Keyrings with duplicate accounts are skipped as unsupported on unlock ([#5775](MetaMask/core#5775)) ## [21.0.6] ### Changed - Prevent emitting `:stateChange` from `withKeyring` unnecessarily ([#5732](MetaMask/core#5732)) ``` and `@metamask/accounts-controller` to `^29.0.0`: ```markdown ## [29.0.0] ### Changed - **BREAKING:** bump `@metamask/keyring-controller` peer dependency to `^22.0.0` ([#5802](MetaMask/core#5802)) ## [28.0.0] ### Added - Add new `setAccountNameAndSelectAccount` action ([#5714](MetaMask/core#5714)) - Add `entropySource` and `derivationPath` to EVM HD account options ([#5618](MetaMask/core#5618)) ### Changed - **BREAKING:** Bump `@metamask/snaps-controllers` peer dependency from `^9.19.0` to `^11.0.0` ([#5639](MetaMask/core#5639)) - **BREAKING:** Bump `@metamask/providers` peer dependency from `^18.1.0` to `^21.0.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/base-controller` from `^8.0.0` to `^8.0.1` ([#5722](MetaMask/core#5722)) - Bump `@metamask/snaps-sdk` from `^6.17.1` to `^6.22.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/snaps-utils` from `^8.10.0` to `^9.2.0` ([#5639](MetaMask/core#5639)) - Bump `@metamask/eth-snap-keyring` from `^12.0.0` to `^12.1.1` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-api` from `^17.2.0` to `^17.4.0` ([#5565](MetaMask/core#5565)) - Bump `@metamask/keyring-internal-api` from `^6.0.0` to `^6.0.1` ([#5565](MetaMask/core#5565)) ### Fixed - Do not fire events during `update` blocks ([#5555](MetaMask/core#5555)) - Prevent unnecessary state updates when updating `InternalAccount.metadata.snap` ([#5735](MetaMask/core#5735)) ``` [](https://codespaces.new/MetaMask/metamask-extension/pull/32621?quickstart=1) ## **Related issues** Fixes: #32935 ## **Manual testing steps** ### 1. Add duplicate to the wallet state 1.1. Switch to the `v11.7.3` branch, build locally, and install the extension from `chrome://extensions` 1.2. Onboard with an SRP of which we know the second account (`child guilt hollow arrive average popular nasty soon summer like scheme diary pill country rapid`) 1.3. Import an account that is part of the mnemonic ( `0x80842b7e3cfb1118e86a427cdec418e3b4179ef5bbbfd71c02a76349831c8a8b` which is the account at index 2 of the above SRP) 1.4. Add a new account on the main HD 1.5. Switch to `Version-v12.17.1` branch, and refresh the extension in `chrome://extensions` 1.6. Unlock the wallet, you should see duplicates in your accounts list and you won't be able to add new accounts ### 2. Test the fix 2.1. Switch to this branch, build locally, and refresh the extension in `chrome://extensions` 2.2 Unlock the wallet, you shouldn't see duplicate accounts anymore, and you should be able to add new accounts ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] 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. --------- Co-authored-by: Mark Stacey <mark.stacey@consensys.net>
Dependent on:
Explanation
It is no longer possible to persist duplicates in the vault, though users that already have duplicates will see them in the accounts list, and won't be able to do any action with their vault. These changes aim to discard duplicates, moving the keyring including a duplicate account to the unsupported array.
Can be tested on extension with MetaMask/metamask-extension#32621
References
Changelog
Checklist