Skip to content
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

fix: cherrypick 759b92e to v12.1.0 #26617

Closed
wants to merge 1 commit into from

Conversation

montelaidev
Copy link
Contributor

@montelaidev montelaidev commented Aug 22, 2024

This pr cherry picks the fix for #26377

This PR bumps the AccountsController and introduces a new migration. The updateAccounts methods from the AccountsController now checks if the selectedAccount is undefined and recovers from this. The migration updates the selectedAccount values that are not defined.

Open in GitHub Codespaces

Fixes: #26377

  1. Go to this page... 2.
  • I've followed MetaMask Contributor Docs and MetaMask Extension Coding
    Standards
    .

  • 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 format if applicable

  • I’ve applied the right labels on the PR (see labeling guidelines). 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.


Description

Open in GitHub Codespaces

Related issues

Fixes:

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.

…Account (#26573)

<!--
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 bumps the `AccountsController` and introduces a new migration.
The `updateAccounts` methods from the `AccountsController` now checks if
the selectedAccount is undefined and recovers from this. The migration
updates the selectedAccount values that are not defined.

<!--
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?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26573?quickstart=1)

Fixes: #26377

1. Go to this page...
2.
3.

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

<!-- [screenshots/recordings] -->

<!-- [screenshots/recordings] -->

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.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
- [x] 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-extension/blob/develop/.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: MetaMask Bot <metamaskbot@users.noreply.github.com>
Copy link
Contributor

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.

Copy link

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@metamask/accounts-controller@18.1.0 None 0 391 kB metamaskbot
npm/@metamask/approval-controller@7.0.2 None 0 238 kB metamaskbot
npm/@metamask/json-rpc-engine@9.0.2 None 0 198 kB metamaskbot
npm/@metamask/key-tree@9.1.2 None 0 799 kB metamaskbot
npm/@metamask/rpc-errors@6.3.1 None 0 133 kB metamaskbot
npm/@metamask/slip44@3.1.0 None 0 128 kB metamaskbot
npm/@metamask/snaps-utils@7.8.1 network 0 1.04 MB metamaskbot
npm/@metamask/superstruct@3.1.0 None 0 437 kB metamaskbot
npm/@types/http-errors@2.0.4 None 0 6.59 kB types
npm/@types/serve-static@1.15.5 None 0 7.77 kB types
npm/@types/yargs-parser@21.0.3 None 0 8.65 kB types
npm/apg-js@4.4.0 filesystem 0 1.46 MB ldthomas
npm/axios@1.7.4 network 0 2.12 MB jasonsaayman
npm/clean-css@5.3.3 environment, filesystem, network 0 493 kB jakub.pawlowicz
npm/core-js-pure@3.38.0 environment, eval, filesystem 0 1.1 MB zloirock
npm/cron-parser@4.6.0 filesystem 0 148 kB harrisiirak
npm/escape-string-regexp@4.0.0 None 0 3.79 kB sindresorhus
npm/eta@3.4.1 None 0 272 kB nebrelbug
npm/fast-xml-parser@4.4.1 None 0 172 kB amitgupta
npm/html-entities@2.5.2 None 0 287 kB mdevils
npm/http-parser-js@0.5.8 None 0 25.8 kB jimbly
npm/import-fresh@3.3.0 None 0 4.87 kB sindresorhus
npm/marked@12.0.1 None 0 923 kB tonybrix
npm/rfdc@1.3.0 None 0 24 kB davidmarkclements
npm/stream-http@3.2.0 None 0 26.8 kB jhiesey
npm/strnum@1.0.5 None 0 17.7 kB amitgupta
npm/websocket-driver@0.7.4 network 0 67.4 kB jcoglan

🚮 Removed packages: npm/@metamask/accounts-controller@17.0.0), npm/@metamask/approval-controller@7.0.0), npm/@metamask/json-rpc-engine@8.0.2), npm/@metamask/key-tree@9.1.1), npm/@metamask/rpc-errors@6.2.1), npm/@types/serve-static@1.15.1), npm/@types/yargs-parser@15.0.0), npm/apg-js@4.1.1), npm/axios@1.6.8), npm/clean-css@5.3.2), npm/core-js-pure@3.30.2), npm/eta@3.2.0), npm/html-entities@2.3.3), npm/http-parser-js@0.4.9), npm/import-fresh@3.2.1), npm/stream-http@3.1.1), npm/websocket-driver@0.7.0)

View full report↗︎

Copy link

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSourceCI
Network access npm/@metamask/snaps-utils@7.8.1 🚫
Network access npm/axios@1.7.4 🚫

View full report↗︎

Next steps

What is network access?

This module accesses the network.

Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

  • @SocketSecurity ignore npm/@metamask/snaps-utils@7.8.1
  • @SocketSecurity ignore npm/axios@1.7.4

@gantunesr
Copy link
Member

@montelaidev lets cherry-pick this into the next release

@gantunesr
Copy link
Member

@gantunesr gantunesr closed this Aug 22, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants