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

Prevent freezing UI rendering while pre-deriving accounts from mnemonic #1454

Merged
merged 1 commit into from
May 12, 2023

Conversation

lukaw3d
Copy link
Member

@lukaw3d lukaw3d commented May 12, 2023

Fixes #1453

@lukaw3d lukaw3d requested review from buberdds and csillag May 12, 2023 01:33
@github-actions
Copy link

github-actions bot commented May 12, 2023

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ EDITORCONFIG editorconfig-checker 2 0 0.02s
✅ REPOSITORY checkov yes no 15.77s
✅ REPOSITORY git_diff yes no 0.0s
✅ TYPESCRIPT eslint 2 0 0 4.34s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: d03bf1e
Status: ✅  Deploy successful!
Preview URL: https://f4d689f9.oasis-wallet.pages.dev
Branch Preview URL: https://lw-dont-freeze-mnemonic.oasis-wallet.pages.dev

View logs

@codecov
Copy link

codecov bot commented May 12, 2023

Codecov Report

Merging #1454 (d03bf1e) into master (85ec1b6) will increase coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1454      +/-   ##
==========================================
+ Coverage   83.02%   83.10%   +0.07%     
==========================================
  Files         154      154              
  Lines        4041     4042       +1     
  Branches      726      726              
==========================================
+ Hits         3355     3359       +4     
+ Misses        686      683       -3     
Flag Coverage Δ
cypress 51.11% <100.00%> (+0.20%) ⬆️
jest 78.14% <100.00%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/app/state/importaccounts/saga.ts 92.92% <100.00%> (+0.07%) ⬆️

... and 4 files with indirect coverage changes

@lukaw3d lukaw3d merged commit 341daa9 into master May 12, 2023
@lukaw3d lukaw3d deleted the lw/dont-freeze-mnemonic branch May 12, 2023 15:39
@@ -66,6 +66,7 @@ function* enumerateAccountsFromMnemonic(action: PayloadAction<string>) {

try {
yield* setStep(ImportAccountsStep.LoadingAccounts)
// Pre-derive all pages of accounts so we don't need to store mnemonic in redux.
for (let i = 0; i < accountsPerPage * numberOfAccountPages; i++) {
const signer = yield* call(oasis.hdkey.HDKey.getAccountSigner, mnemonic, i)
Copy link
Contributor

Choose a reason for hiding this comment

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

does the scheme allow us to do the expensive part once instead of 48 times?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

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

Successfully merging this pull request may close these issues.

Importing mnemonic on phone freezes the UI for some seconds
3 participants