fix keeping the wallet unlocked after service worker restarted more than once#17950
Merged
pedronfigueiredo merged 1 commit intodevelopfrom Mar 1, 2023
Merged
fix keeping the wallet unlocked after service worker restarted more than once#17950pedronfigueiredo merged 1 commit intodevelopfrom
pedronfigueiredo merged 1 commit intodevelopfrom
Conversation
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. |
brad-decker
approved these changes
Mar 1, 2023
jpuri
approved these changes
Mar 1, 2023
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
submitEncryptionKeyon themetamask-controller.js, the vault is a string, not an object. So to correctly compare the salt, we need to parse that string into JSON.Note that this PR does not fix the first time the service worker is restarted after a fresh wallet is loaded and the onboarding flow is complete. This will be fixed in a separate PR. However, in any number of subsequent restarts, the unlock state is now persisted.
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 merged immediately after made the wallet lock more immediate.
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.
Input the password and unlock the wallet
Terminate the service worker again (repeat step 3)
The wallet should lock after a couple of seconds.
Build the wallet from this branch
git checkout fix/keep-user-login && 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.
Input the password and unlock the wallet
Terminate the service worker again (repeat step 11)
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.