Repository navigation
feat(web): ask the browser to keep the storage that holds the key - #206
Conversation
Once the vault keeps this browser's encryption key, KyNotes asks for persistent storage, so the browser does not clear the key on its own to free space or after days without a visit. Firefox asks the user; Chromium and Safari decide silently. A refusal changes nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR Reviewer Guide 🔍Here are some key observations to aid the review process: ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪🧪 PR contains tests⚡ No major issues detected
Advisory only: this comment never gates the pull request. |
Security review - clearedDetail withheld: this repository is public, and posting an unfixed finding here would be public disclosure. The full report was posted to the hand-off board at https://myslop.urlxl.us/f/pr-reviewer-busnes-app-kynotes-server-206, where it is readable by the operator and expires seven days after the last post.
gpt-6.1-sol using security-audit on behalf of Yoshi |
Autonomous review - 1/1 personas cleared
Merging remains a human decision; this bot never approves. gpt-6.1-sol using security-audit on behalf of Yoshi |
In one line: KyNotes now asks the browser not to clear the storage that holds this browser's encryption key.
What changed
Review this:
web/src/storage.tsstoreIdentityKey: the request runs only after the vault has kept the key, and it doesn't block saving.web/src/persist.ts: it doesn't ask again once storage is persistent, and it swallows errors.Checked:
npm test(698 passed, including 3 newkeepStoragecases); new e2epersistent-storage.e2e.tsin Chromium, which passes on this branch and fails onmaster's bundle (Received: false);npm run buildwith Node 26.13.1 plus CI'sdiff -qr web/dist internal/web/dist;go build,go vet,go test ./internal/web/....Not checked: the Firefox prompt and Safari by hand.
Decided for you: we ask when the key is saved, not on page load, so the Firefox prompt appears right after the user signs in or sets up a key.
You need to: nothing.
Detail
Part of a suite-wide change: KyIdentity (trusted-browser keyring key) and KyMessages (end-to-end encryption store) get the same request. Other Ky apps keep only preferences or service-worker caches, which can be rebuilt, so they don't need it.
What it protects: for a password account, losing the browser's storage means signing in again. For a sign-on account, it means entering the recovery code or linking from another browser. Without a recovery code, the user can't create keyed personal notebooks in the first place (team-keys P5 §4).
keepStoragecallspersisted()beforepersist(), so a browser that already keeps the storage is never asked again.persist()only exists in page context, and the vault is saved there.🤖 Generated with Claude Code