fix: WALLET-1364 — close the P3 residual - #1466
Open
ost-ptk wants to merge 8 commits into
Open
Conversation
…re-encrypt debounce
…rd the change-password submit
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes the six residual P3 defects recorded in WALLET-1364. Stacked on #1465 — review that one
first; this branch builds on the
runKeysDownloadextraction it introduces.Jira: https://make-software.atlassian.net/browse/WALLET-1364
What each change removes
takeEvery; everything re-derivable or cosmetic stays debounced.navigate(Home)sat outside both worker callbacks and ran unconditionally. The user landed on Home believing their password had changed when it had not. Navigation now happens only inonmessage;onerrorshows a field error and stays put.onerrorhandlers stopped the spinner with no message — indistinguishable from a wrong password, which the same screen reports properly a few lines above.createAsymmetricKeysreturnedsecretKey: nullwere silently omitted from the zip while Success was shown. Now the export fails loudly, before anything is written to disk, and logs a count only.===style-srchad no'self''unsafe-inline'matches no external stylesheet, and every app template links/assets/fonts/fonts.css. Fixed inwebpack.config.jsand in Safari's hand-maintained runtime CSP insrc/utils.ts, which had drifted the same way.Item 15 (QR sync uses AES-CBC with no MAC) is deliberately not fixed — see below.
Two things a review found that are worth your attention
A watch account used to break the whole export. Watch accounts are stored with
secretKey: ''and no
hardwareflag, so they passed the export list's!account.hardwarefilter. Item 13'sfail-loudly rule then meant a user with three real accounts and one watch account got no archive
at all. That is worse than the bug being fixed, so the export list now excludes accounts with
nothing to export (
selectVaultAccountsAvailableForExport), and the hard failure is reserved for agenuinely unexpected null — data corruption, which should still never be shown as success.
Change-password now waits for the worker, so it needed a submitting state. Navigation correctly
moved inside
onmessage, which leaves the page on screen for the worker's two scrypt passes(N=2¹⁸, roughly 1-2 s). Without a guard, two taps spawn two ~256 MB scrypt workers in the popup.
It now mirrors the
isSubmittingpattern already used bypassword-protection-page.Limitations, stated rather than buried
breakon thefirst mismatch does not change the output —
|=is monotonic — only the timing. The tests provethe comparison is correct; the in-code comment is the only thing standing between a future edit
and a reintroduced short-circuit. Worth knowing before touching that loop.
testEnvironment: 'node'with no jsdom, so change-password and unlock-vault cannot beunit-tested. Code reading was the only verification. Items to click through are listed below.
change-passworddisables the submit button while the worker runs, but unlike its siblingpassword-protection-pageit does not also guard Enter re-submission or make the fieldread-only. The button guard covers the double-tap vector the review raised; the parity gap is
noted rather than closed here.
password-protection-page's ownworker.onerroris still silent. It was scoped out of theticket, so two of the three password screens now report worker failure and one does not.
Something went wrong. Please try again.has no catalogue entry, so the eightnon-English locales fall back to English.
locale:extract_potwas deliberately not run —lang/is hundreds of msgids behind and regenerating it would swamp this diff. A shorter
Something went wrongalready exists in four places; consolidating is a reasonable follow-up.Why item 15 is not here
generate-sync-wallet-qr-data-worker.tsstill uses AES-CBC with no MAC. The format is across-application contract:
casper-wallet-mobile/src/utils/aes/index.tsdecrypts it withaes-256-cbcand identical scrypt parameters (N = 2¹⁸, r = 8, p = 1, dkLen = 32), and itsreact-native-aes-cryptoexposes CBC only. Changing the extension alone breaks wallet sync until amatching mobile release ships. The residual risk is also narrow — the ciphertext travels from the
user's own screen to their own camera. If picked up, it needs a versioned envelope landed on mobile
first.
Please verify before merging
The CSP change needs a real browser, which is the one thing this branch cannot settle itself:
npm run build:firefox, loadbuild/firefoxviaabout:debugging, open the popup and theonboarding page, and check the console for a blocked-stylesheet violation on
fonts.css—before and after. Same for the Safari build.
disabled while it runs.
offered at all.
npm run ci-checkis green: 90 suites, 881 tests.