Repository navigation
fix(desktop): drop in-flight folder/people loads that finish after an account switch - #9829
Merged
Merged
Conversation
… account switch AppState cleared folders/people on .runtimeOwnerDidChange, but loadFolders() and fetchPeople() had no owner fence: a previous account's in-flight response landing after the reset repopulated the cleared state, and the skip-while-non-empty reload guards then pinned the stale data for the new account. Add ownerScopeGeneration, bumped by resetOwnerScopedContent(); the loads capture it before awaiting and drop their result if it moved (same pattern as ConversationRepository.requestGeneration). Injectable fetch seams enable hermetic race coverage. Verification: two new behavioral regressions (a gate-suspended folder load and people fetch complete AFTER .runtimeOwnerDidChange and are ignored) — 30 tests green across the fence suites; live account-switch round trip re-verified on the named bundle at this commit (conversations render → swap_test_owner clears to empty state → restore_test_owner returns). Co-Authored-By: Claude Fable 5 <[email protected]>
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.
What
Race residual of the account-switch fence series (#9821/#9823/#9826):
AppStatecleared folders/people on.runtimeOwnerDidChange, butloadFolders()/fetchPeople()had no owner fence — a previous account's in-flight response landing after the reset repopulated the cleared state, and the skip-while-non-empty reload guards then pinned the stale data for the new account.Adds
ownerScopeGeneration(bumped byresetOwnerScopedContent()); the loads capture it before awaiting and drop their result if it moved — same pattern asConversationRepository.requestGeneration. Injectable fetch seams enable hermetic race coverage.Verification
.runtimeOwnerDidChangeand are ignored (state stays empty). 30 tests green across the fence suites (ConversationRepositoryTests26 incl. the owner-change regression,MemoriesViewModelOwnerFenceTests,AppStateOwnerFenceTests3).swap_test_ownerclears to the empty state →restore_test_ownerreturns cleanly); two-panel screenshot captured.Product invariants affected
none
🤖 Generated with Claude Code