Repository navigation
fix(desktop): account-scope isolation and state ownership architecture - #33
Merged
Merged
Conversation
Introduce leaveAccountScope as the sole account boundary so A→logout→B cannot retain workspace digests, UI selection, topic cursors, or RQ cache. Stamp immutable outbox accountId and claim only the current account; clear host hit_ on leave and gate Host online on hostCredentialAccountId. Single-flight hydrateAuth avoids refresh-token reuse revoke; instanceCrashed threads projects for Sidebar aggregates.
Route Hub live apply, snapshot reconcile, loadTimeline hydrate/older pages, and optimistic send/delivery patches through store/workspace/timeline-write. Clear unread id dedupe on bridge stop; document the funnel in architecture-desktop.
- Move IM lifecycle/sync/inbound/digest ensure into store/im; shared/lib no longer imports Zustand stores - Add cloud-auth + daemon-status ports to break account↔workspace cycles - Extract collaboration domain types; keep mock-data as fixtures/presentation - Delete unused catalog RQ UI hooks; document RQ as store-loader transport - Hub-primary rail unread already enforced; keep resolveRailUnread tests - Deduplicate send/retry via deliverMessage; split host ensure decision machine
…anup - Never mark user bubbles sent on outbox timeout; throw until acked - Guard timeline funnel writes with account-scope generation - Scope reclaimStaleInflight by accountId; drop unused session RQ hooks - Add pure settlement/generation regression tests; include CLAUDE.md
…ning Surface timeout/errors as failed (WeChat-style retry) while allowing later outbox ack to upgrade the bubble to sent. Serialize host credential clear via a controller so leave aborts stale apply. Split cloud-realtime map and IM agent/outbox post modules to satisfy file-size gates; harden outbox, realtime epoch, and conversation UI selection paths.
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
leaveAccountScopeon logout/switch/auth-invalid; wipe workspace digests, UI selection, topic cursors, RQ cache; outbox rows stamp immutableaccountIdand are claimed only by the current account; hosthit_cleared on leave withhostCredentialAccountIdgating Host online; single-flighthydrateAuth;instanceCrashedupdates project aggregates.timeline-writefunnel formessagesByConversation(Hub live, hydrate, optimistic/delivery); account-scope generation guards late writers after leave; send path never markssentunless outbox acked.store/im/soshared/libno longer imports stores; cloud-auth + daemon-status ports; domain types inshared/domain/; unused catalog RQ hooks removed; host ensure decision machine extracted; Hub-primary rail unread retained/docs aligned;CLAUDE.mdproject instructions included.Commits
113aaf8account-scope leave / outbox / host isolation561bc29timeline write funnela1b367aphases 2–6 ownership, domain types, host ensureaa19c5eadversarial-review fixes (settlement, gen guards, cleanup)Test plan
cd apps/desktop && pnpm check:all(tsc, unit tests, biome, file-sizes, px-text)cargo check -p minos-daemon -p minos-desktop(host clear credential path; run earlier in branch)