-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 recreate vault import accounts #1756
Conversation
const importedAccounts = []; | ||
|
||
// Get imported accounts | ||
if (KeyringController.state.keyrings.length === 2) { |
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.
On the extension we have one keyring for each imported account - I am guessing mobile is the same? So this should handle all keyrings from index 1 onwards.
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.
You are right! Thanks, fixing this now.
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.
Should be fixed now 👍
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.
Few issues
Issue 1: Wallet with 1 imported account produces an error "Error: Invalid password"
Issue 2: Wallet with 2 imported accounts does allow you create password, however, the imported accounts are lost
Here goes my set up/steps:
- I built v0.2.19
- I then created 3 wallets (no password set/nor no back up)
wallet 1 = 1 account with 1 imported account
wallet 2 = 1 account with 2 imported accounts
wallet 3 = 3 accounts with 1 imported account
-
I then switched to this branch and ran yarn clean, yarn watch:clean, and yarn start:android
-
Upon building this branch, after being prompted to create a password these are the results; seen here = https://recordit.co/189ncJf7qX
wallet 1 = upon attempting to create a password it gave me the "Invalid password" error
wallet 2 = it did allow me to create password, however, my imported accounts are no longer there
wallet 3 = same error as wallet 1
I believe this is due to what @Gudahtt mentioned here: #1756 (comment) |
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.
Issue 1 has been fixed 👍 in regards to no longer showing the error on password creation
Issue 2 still happens to both wallets with 1 imported account and wallets with 2 or more imported accounts
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.
Fixes look good, QA Passed 👍
importedAccounts = [...importedAccounts, ...simpleKeyringAccounts]; | ||
} | ||
} catch (e) { | ||
console.warn(e); |
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.
what if we use the logger here to get the errors in sentry?
await KeyringController.importAccountWithStrategy('privateKey', [importedAccounts[i]]); | ||
} | ||
} catch (e) { | ||
console.warn(e); |
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.
same here
* fix recreate vault * Improve getting simple key pair keys * Introduce try catch around imported accounts * Fix for multiple imported accounts * remove unecessary async await * Use old password * use logger on recreate vault
Description
This fixes imported accounts getting deleted when the vault is recreated
Checklist
Issue
Resolves #1105