Data not scoped by account — logout leaks state #18
Labels
No labels
auth
bug
composer
correctness
database
durability
enhancement
feeds
interactions
notifications
performance
reliability
safety
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starsetbyte/peregrine#18
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Logout clears auth but not Room/DataStore. Second account sees first account's drafts, timeline, feeds.
Proposed fix
Clear account-bound data on logout. Better: accountDid on entities or separate DB per DID.
Source: Codex code review — technical #3
Fix up in PR #30 (
fix/logout-clears-account-data).Implemented the issue's proposed clear-on-logout fix: a new
AccountDataCleanerwipes every account-bound store on logout — Room (clearAllTables: posts/cursors/drafts/notifications), draft image files on disk, the cached feed preferences (including the@Singleton's in-memory snapshot), and recent searches. Theme / dynamic-color / migration-dismissed are preserved (device-level, not account-level).Two things deliberately left as follow-ups, noted in the PR:
TokenAuthenticator's forced logout callsSessionManager.clearSession()directly rather thanlogout(), so expiry-then-different-account isn't covered. Cleanest to fix alongside per-DID scoping by clearing at the login boundary — that also covers OAuth login, which bypassesAuthRepository(saves viaOAuthLoginViewModel).Will auto-close on merge.