Repository navigation
feat(e2ee): ask the browser to keep the storage that holds device keys - #56
Conversation
Once a device's encryption store is open, KyMessages asks for persistent storage, so the browser does not clear the device's keys and room sessions 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-kymessages-native-56, 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: KyMessages now asks the browser not to clear the storage that holds this device's encryption keys and room sessions.
What changed
Review this:
web/src/chat/e2ee.tsopenStore: the request runs only for a device starting up, and it never blocks start-up. The sign-out and reset paths that also open the store don't ask.web/src/persist.ts: it doesn't ask again once storage is persistent, and it swallows errors.Checked:
npm test: 214 passed, including 3 newkeepStoragecases.npm run buildwith Node 26.13.1. Only the main JS chunk changed, and the committedweb/distmatches the build.e2ee-store-signout.spec.mjs, run in every project: 18 of 18 passed across Chromium (4 projects) and Firefox (2), alongside the two existing store tests.main's bundle in Chromium and Firefox (Received: false).go build -o .browser/server ./cmd/server,go vet ./web/....Not checked: Safari, and the Firefox prompt's look by hand.
Decided for you: we ask when the device starts, which is at sign-in, not on page load, so the Firefox prompt appears right after signing in.
You need to: nothing.
Detail
This is part of a suite-wide change. KyNotes (Busnes-app/KyNotes-server#206) and KyIdentity (Busnes-app/KyIdentity-server#306) get the same request. Other Ky apps keep only preferences or service-worker caches, which can be rebuilt, so they don't need it.
keepStoragecallspersisted()beforepersist(), so a browser that already keeps the storage is never asked again.persist()only exists in page context, and the device starts there.web/AGENTS.mdandweb/browser/AGENTS.mddescribe the new behaviour and test.🤖 Generated with Claude Code