Skip to content
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

add: methods to store a seed temporarily #1056

Open
wants to merge 9 commits into
base: v2
Choose a base branch
from

Conversation

borislav-itskov
Copy link
Member

@borislav-itskov borislav-itskov commented Oct 29, 2024

Here's what we do:

  • add a #tempSeed in the keystore
  • add a method addSeedToTemp in the keystore that will add the seed to temp encrypted
  • add deleteTempSeed - if the user declines to save the seed, we delete it from temp
  • add moveTempSeed - if the user wants the seed stored, we move it to keystoreSeeds

The flow from account adder is as follows:

  • users doesn't have a saved seed
  • user imports one, we save it to temp encryptedly
  • he adds his accounts, personalizes them, goes to final step - do you want to save the imported seed
  • if he clicks yes, we store it and remove it from temp
  • if he clicks no, we delete it from temp

If the user doesn't complete the login process (rage quits as account personalize), the temp seed remains in the keystore until the user locks his extension or the background process is restarted/reloaded. If the user locks his extension, we delete the temp seed. This is visible in the ambire-app PR (yet to be published)

…ed if something break along the way and he isn't able to complete his login
… seed didn't get persisted into storage after being moved from temp
if (shouldUpdate) this.emitUpdate()
}

async addTempSeedToKeystoreSeeds() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add await this.#initialLoadPromise, just in case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants