This repository was archived by the owner on Oct 7, 2024. It is now read-only.
fix keeping the wallet unlocked on sw restart after onboarding#203
Merged
pedronfigueiredo merged 7 commits intomainfrom Mar 6, 2023
Merged
fix keeping the wallet unlocked on sw restart after onboarding#203pedronfigueiredo merged 7 commits intomainfrom
pedronfigueiredo merged 7 commits intomainfrom
Conversation
Gudahtt
reviewed
Mar 3, 2023
Gudahtt
reviewed
Mar 3, 2023
Member
Gudahtt
left a comment
There was a problem hiding this comment.
Looks great! Great to have these additional tests, but I think the code being changed here isn't yet adequately covered. I can approve once it's covered by at least one test
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Gudahtt
reviewed
Mar 3, 2023
Gudahtt
reviewed
Mar 3, 2023
Gudahtt
previously approved these changes
Mar 3, 2023
Member
Gudahtt
left a comment
There was a problem hiding this comment.
LGTM! Left a comment on two tests that can still be improved
e33481e to
b0a4300
Compare
brad-decker
approved these changes
Mar 6, 2023
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
We want to keep the wallet unlocked when a service worker restarts.
In
persistAllKeyrings, when we're building for mv3 and want to cache theencryptionKeybut a password was entered and a newencryptionKeyhas been generated, we want to saveencryptionSaltalongside the newencryptionKeyin the keyring controllermemStore.This is so it can be saved in storage and then retrieved on the metamask controller for the extension.
Note that this PR only fixes the first time the service worker is restarted after a fresh wallet is loaded and the onboarding flow is complete. Unlocked wallet persistence for subsequent service worker restarts has been fixed on a separate PR on the extension repository.
For context, this was previously addressed, but the wallet was still locked after a long enough waiting period after the service worker restarted. Another PR has since been merged, making the wallet lock more immediately apparent.
Manual Testing Steps
git checkout develop && git pull && yarn && yarn:start:mv3Load the wallet in the browser and complete the onboarding flow
Terminate the service worker using
chrome://inspect/#service-workers.The wallet should lock after a couple of seconds.
Add the changes on
index.json this PR to the corresponding file on thenode_modulesfolder of the Metamask Extension.Build the wallet again.
Load the wallet in the browser and complete the onboarding flow
Terminate the service worker using
chrome://inspect/#service-workers.The wallet should remain unlocked.
Pre-merge author checklist
Pre-merge reviewer checklist
If further QA is required (e.g. new feature, complex testing steps, large refactor), add the
Extension QA Boardlabel.In this case, a QA Engineer approval will be be required.