fix(logout): no draft or search opt-in left behind after logout (#319, #296) #371

Merged
jared merged 1 commits from fix/logout-wipe-leftovers into lotus 2026-10-17 17:51:34 -04:00
Owner

Fixes #319, fixes #296.

  • #319: logout wiped the drafts and then reloaded the page. The reload's pagehide made RoomInput flush the open composer's (decrypted) draft straight back to localStorage.
    • clearPlaintextCaches now sets a module flag, and persistDraft stops writing once it's set. The flag resets with the new page.
  • #296: the device-wide encrypted-search opt-in (searchCacheEnabled) survived logout, so the next account on the device started indexing decrypted text without opting in.
    • It's now cleared, along with the SDK's per-user filter key.

Verified headless with a throwaway account: search opt-in on, "SECRET half-typed reply" in the composer, then Settings → Log out.

  • Before: the draft and searchCacheEnabled=true remained.
  • After: neither does.

Unit test added. tsc clean · unit tests pass · ESLint/Prettier clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5

Fixes #319, fixes #296. - **#319:** logout wiped the drafts and then reloaded the page. The reload's `pagehide` made `RoomInput` flush the open composer's (decrypted) draft **straight back** to localStorage. - `clearPlaintextCaches` now sets a module flag, and `persistDraft` stops writing once it's set. The flag resets with the new page. - **#296:** the device-wide **encrypted-search opt-in** (`searchCacheEnabled`) survived logout, so the next account on the device started indexing decrypted text without opting in. - It's now cleared, along with the SDK's per-user filter key. **Verified** headless with a throwaway account: search opt-in on, "SECRET half-typed reply" in the composer, then Settings → Log out. - **Before:** the draft and `searchCacheEnabled=true` remained. - **After:** neither does. Unit test added. `tsc` clean · unit tests pass · ESLint/Prettier clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared added 1 commit 2026-10-16 22:12:23 -04:00
fix(logout): no draft or search opt-in left behind after logout (#319, #296)
CI / Build & Quality Checks (pull_request) Successful in 3m48s
CI / Trigger Desktop Build (pull_request) Skipped
CI / Docker image build & smoke test (pull_request) Skipped
CI / Secret scan (gitleaks) (pull_request) Successful in 9s
CI / Playwright smoke (e2e) (pull_request) Successful in 15m26s
78691f1fff
- #319: logout wiped the drafts, then reloaded, and the reload's pagehide
  made RoomInput flush the open composer's (decrypted) draft straight back
  to localStorage. clearPlaintextCaches now sets a module flag and
  persistDraft stops writing once it's set (resets with the new page).
- #296: the device-wide encrypted-search opt-in (searchCacheEnabled)
  survived logout, so the next account started indexing decrypted text
  without opting in. It's now cleared, along with the SDK's per-user
  filter key.

Verified headless with a throwaway account (search opt-in on, "SECRET
half-typed reply" in the composer, Settings → Log out): before, the draft
and searchCacheEnabled=true remained; now neither does. Unit test added.

Fixes #319
Fixes #296

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared merged commit 76ef8a52c7 into lotus 2026-10-17 17:51:34 -04:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#371