Skip to content

Conversation

@montelaidev
Copy link
Contributor

Explanation

This PR fixes the edge case that leads to the reset of the Accounts Controller state. The accounts controller listens to the keyring controller state change, when the extension client executes two submit passwords in succession, there is a race condition where the keyring controller would empty its keyring state causing the accounts controller to clear its state.

References

For example:

Changelog

@metamask/accounts-controller

  • CHANGED: onKeyringState only triggers when the keyring controller is unlocked and has keyrings.

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • [] I've highlighted breaking changes using the "BREAKING" category above as appropriate

…eyrings can causing accounts controller to also clear its state
@montelaidev montelaidev self-assigned this Jan 20, 2024
@montelaidev montelaidev requested a review from a team as a code owner January 20, 2024 09:30
@montelaidev montelaidev changed the title fix: submit password case that leads to keyring controller clearing k… Fix: Quick Succession of pubmit password case causing Accounts Controller State to be cleared. Jan 20, 2024
@montelaidev montelaidev requested a review from danroc January 20, 2024 09:32
@montelaidev montelaidev changed the title Fix: Quick Succession of pubmit password case causing Accounts Controller State to be cleared. Fix: Quick Succession of submit password case causing Accounts Controller State to be cleared. Jan 22, 2024
@danroc danroc changed the title Fix: Quick Succession of submit password case causing Accounts Controller State to be cleared. Fix: Quick Succession of submit password case causing Accounts Controller State to be cleared Jan 22, 2024
@danroc danroc changed the title Fix: Quick Succession of submit password case causing Accounts Controller State to be cleared fix: quick Succession of submit password case causing Accounts Controller State to be cleared Jan 22, 2024
@danroc danroc changed the title fix: quick Succession of submit password case causing Accounts Controller State to be cleared fix: quick succession of submit password case causing Accounts Controller state to be cleared Jan 22, 2024
@danroc danroc changed the title fix: quick succession of submit password case causing Accounts Controller state to be cleared fix: quick succession of submit password causing Accounts Controller state to be cleared Jan 22, 2024
@montelaidev montelaidev merged commit b74c48d into main Jan 22, 2024
@montelaidev montelaidev deleted the fix/ap-215-fix-submit-password-case branch January 22, 2024 12:45
Gudahtt added a commit that referenced this pull request Jan 22, 2024
…roller-in-sync-with-keyrings

* origin/main:
  chore(deps): bump @metamask/eth-keyring-controller from 17.0.0 to 17.0.1 (#3805)
  fix: custody keyring name (#3803)
  chore: update dependencies for `@metamask/accounts-controller` (#3747)
  fix: quick succession of submit password causing Accounts Controller state to be cleared (#3802)
  feat: add methods to support ERC-4337 accounts (#3602)
  feat: add getAccount action to AccountsController (#1892)
Gudahtt added a commit that referenced this pull request Jan 22, 2024
…roller-in-sync-with-keyrings

* origin/main:
  chore(deps): bump @metamask/eth-keyring-controller from 17.0.0 to 17.0.1 (#3805)
  fix: custody keyring name (#3803)
  chore: update dependencies for `@metamask/accounts-controller` (#3747)
  fix: quick succession of submit password causing Accounts Controller state to be cleared (#3802)
  feat: add methods to support ERC-4337 accounts (#3602)
  feat: add getAccount action to AccountsController (#1892)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants