-
Notifications
You must be signed in to change notification settings - Fork 5k
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
feature/sync imported accounts with mobile #8631
Conversation
Builds ready [ea1f89f]
Page Load Metrics (594 ± 51 ms)
|
Builds ready [16ebe5d]
Page Load Metrics (810 ± 39 ms)
|
It looks like something went wrong when you tried resolving that conflict. Lots of deleted files. |
Co-authored-by: Mark Stacey <[email protected]>
16ebe5d
to
5dd8bfd
Compare
I've rebased the first two commits onto develop, re-resolving the conflicts to avoid the deletions |
Builds ready [5dd8bfd]
Page Load Metrics (701 ± 29 ms)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this results in the duplication of all accounts when you have two or more imported accounts (as you discovered and reported on Slack).
This is happening because submitPassword
is called as part of the exportAccount
action, which is now being called multiple times asynchronously. submitPassword
should never be called while another submitPassword
call is still resolving, because it will dump and re-add all keyrings. So in this case, if you have two imported accounts, it will re-add all keyrings twice resulting in duplicate accounts.
There are a few different ways I can think of to fix this:
- Separate the password validation step from the
exportAccount
step. We could update theexportAccount
action to just export the account, and verify the password separately. - Export accounts one-at-a-time, instead of in parallel.
- Add a method to the keyring controller to validate the password without dumping and re-adding all keyrings, and use that here instead.
The simplest solution would be 2), but 1) and 3) are things we should probably do regardless, just to make this faster and less flaky.
@Gudahtt ok thanks for that context, I'll fix it |
@Gudahtt I created a new action method called
In a sense I did 3. but not at Keyring Controller level, just an action that checks if the password is correct once, after that is validated it goes to get the private keys to the Keychain, following what WDYT? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a good solution!
Builds ready [84816d9]
Page Load Metrics (729 ± 57 ms)
|
The purpose of this PR is to send data of imported accounts to mobile app while doing sync. Related PR on mobile MetaMask/metamask-mobile#1591