Conversation
…unlock prompt Clicking a `.md.age` note while the vault is locked calls `requireUnlock`, which registers a pending promise and opens the crypto panel. When that panel opens in setup / set-passphrase mode (device not yet enrolled, or no passphrase set), the user "sets a password" instead of "unlocking". Both `crypto_setup` and `crypto_set_passphrase` auto-unlock the vault in Rust, but only the store's `unlock()` resolved the pending promise. So after a successful setup the form's `onDone` closed the panel, `closePanel` rejected the pending promise as a cancel, and `openNote` silently bailed out — the note never opened and nothing happened. Resolve the pending unlock from `setup` and `setPassphrase` too (once a status refresh confirms the vault is unlocked), via a shared `resolvePendingUnlock` helper now also used by `unlock`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M2CsK2HG7jUuJBVi94t7Jk
|
|
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.
Summary
Fixes a bug where clicking a locked encrypted note (
.md.age), being prompted to set a password, setting it, and then having the note silently fail to open — nothing happened.Clicking a
.md.agenote while the vault is locked callsrequireUnlock(src/stores/crypto.ts), which registers a pending promise and opens the crypto panel. When that panel opens in setup / set-passphrase mode (this device isn't enrolled yet, or no passphrase is set), the user sets a password rather than unlocking.Both
crypto_setupandcrypto_set_passphraseauto-unlock the vault on the Rust side, but only the store'sunlock()resolved the pending promise. So after a successful setup the form'sonDoneclosed the panel,closePanelrejected the pending promise as if it were a user cancel, andopenNotebailed out silently — the note never opened.The fix resolves the pending unlock from
setupandsetPassphrasetoo (once a status refresh confirms the vault is unlocked), via a sharedresolvePendingUnlockhelper now also used byunlock.Related issues
Type of change
How was this tested?
npm run lintpassesnpm run buildpasses (tsc && vite build, exit 0)cargo fmt --check && cargo clippy— not run (no Rust changes)cargo test— not run (no Rust changes)requireUnlockpromise soopenNoteproceeds tonote_readinstead of treating the panel close as a cancelScreenshots / recordings
Contributor License Agreement
🤖 Generated with Claude Code
https://claude.ai/code/session_01M2CsK2HG7jUuJBVi94t7Jk
Generated by Claude Code