Skip to content

fix: cp-7.47.0 discard duplicate accounts on unlock #15356

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

mikesposito
Copy link
Member

@mikesposito mikesposito commented May 15, 2025

Description

Updating @metamask/keyring-controller to ^22.0.0:

## [22.0.0]

### Changed

- **BREAKING** `keyringsMetadata` has been removed from the controller state ([#5725](https://github.com/MetaMask/core/pull/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](https://github.com/MetaMask/core/pull/5775))

and @metamask/accounts-controller to ^29.0.0:

## [29.0.0]

### Changed

- **BREAKING:** bump `@metamask/keyring-controller` peer dependency to `^22.0.0` ([#5802](https://github.com/MetaMask/core/pull/5802))

Related issues

Fixes: #15437

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

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.

Copy link

socket-security bot commented May 15, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​metamask/​accounts-controller@​28.0.0 ⏵ 29.0.0911007599 +1100
Updatednpm/​@​metamask/​keyring-controller@​21.0.6 ⏵ 22.0.092 +110076 +1100 +1100

View full report

Copy link

socket-security bot commented May 15, 2025

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

@mikesposito mikesposito force-pushed the mikesposito/fix/duplicate-accounts branch from f771ea9 to c8cf951 Compare May 15, 2025 12:48
@mikesposito mikesposito changed the title fix: discard duplicate accounts on unlock fix: cp-7.43.0 discard duplicate accounts on unlock May 15, 2025
@mikesposito mikesposito changed the title fix: cp-7.43.0 discard duplicate accounts on unlock fix: cp-7.47.0 discard duplicate accounts on unlock May 15, 2025
@mikesposito mikesposito added the Run Smoke E2E Requires smoke E2E testing label May 15, 2025

This comment has been minimized.

@mikesposito mikesposito added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels May 19, 2025
Copy link
Contributor

github-actions bot commented May 19, 2025

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 3b284b4
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/390e1958-a2f0-4a56-9a01-19ab9bdde0e8

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@mikesposito mikesposito marked this pull request as ready for review May 19, 2025 09:41
@mikesposito mikesposito requested review from a team as code owners May 19, 2025 09:41
cryptodev-2s
cryptodev-2s previously approved these changes May 19, 2025
Copy link
Contributor

@cryptodev-2s cryptodev-2s left a comment

Choose a reason for hiding this comment

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

LGTM!

OGPoyraz
OGPoyraz previously approved these changes May 20, 2025
@mikesposito mikesposito dismissed stale reviews from OGPoyraz and cryptodev-2s via 5a9b848 May 20, 2025 09:04
@mikesposito mikesposito added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels May 20, 2025
Copy link
Contributor

github-actions bot commented May 20, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: e38066b
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/1b0048f6-df5c-437a-a5ee-cca98c432df0

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

ccharly
ccharly previously approved these changes May 20, 2025
Copy link
Contributor

@ccharly ccharly left a comment

Choose a reason for hiding this comment

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

Code LGTM (mostly basing my review on the equivalent PR on the extension)

I didn't test it though.

},
},
},
test: 'invalid networkConfigurationsByChainId state',
Copy link
Contributor

Choose a reason for hiding this comment

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

Very nit: But I guess this test name is not correct? Must be something like invalid KeyringController.keyringsMetadata state

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch! I think I forgot this here after copying the file from other migrations. Done in a3ec0fb

name: '',
},
],
// TODO: update this
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we want to update the vault to contains the new metadata for each keyring objects, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good question. I thought we needed to update that fixture because we would match IDs coming from the vault's metadata. Though this doesn't seem to be checked by any test, so keyrings included in this vault would simply receive fresh metadata on unlock.

cryptodev-2s
cryptodev-2s previously approved these changes May 20, 2025
Copy link
Contributor

@cryptodev-2s cryptodev-2s left a comment

Choose a reason for hiding this comment

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

LGTM!

@mikesposito mikesposito dismissed stale reviews from cryptodev-2s and ccharly via a3ec0fb May 20, 2025 10:02
@mikesposito mikesposito added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels May 20, 2025
Copy link
Contributor

https://bitrise.io/ Bitrise

🔄🔄🔄 pr_smoke_e2e_pipeline started on Bitrise...🔄🔄🔄

Commit hash: a3ec0fb
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/d38b278b-bc3b-406a-9d1c-9cea5ed7e630

Note

  • This comment will auto-update when build completes
  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Run Smoke E2E Requires smoke E2E testing team-wallet-framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Duplicate accounts in the vault break some user actions
5 participants