fix(app): keep archived sessions open in their tabs - #46165
Open
richard-fairthorne wants to merge 1 commit into
Open
fix(app): keep archived sessions open in their tabs#46165richard-fairthorne wants to merge 1 commit into
richard-fairthorne wants to merge 1 commit into
Conversation
Archiving a session now only updates the session list state. Open tabs keep rendering the archived session: no cache eviction, no navigation to a neighbouring session, no tab removal, no replacement draft tab. Fixes the archive churn reported in anomalyco#35058, where archiving the current session replaced its tab content with another session and could spawn an unrelated new tab via the removal-navigation path. Deletion behaviour is unchanged.
richard-fairthorne
marked this pull request as ready for review
August 29, 2026 16:21
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
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.
Issue for this PR
Closes #35058
Type of change
What does this PR do?
Archiving currently acts as a navigation command. After the
time.archivedwrite succeeds, each archive entry point (in-session options menu, command palette, sidebar rows) runs some combination ofsession.evict,navigateAfterRemoval(to a neighbouring session, the parent session, or a new draft tab), andnotifySessionTabsRemoved(which also navigates). Two racing navigations around a list mutation produce the churn reported in #35058: the archived session's tab gets its content replaced with another session, and an unrelated new tab can open. The SSE event reducer and server-session handler also evict caches for archived sessions, so even a tab that survives loses its messages.This change makes archiving a data operation only. The server write and the sidebar list update remain; the eviction, navigation, and tab-removal calls are removed. An open tab keeps rendering the archived session, and its caches age out through the normal LRU or get wiped on actual deletion. Deletion behaviour is unchanged — it still evicts, removes tabs, and navigates away.
How did you verify your code works?
bun typecheckinpackages/app— cleanevent-reducer.test.tsandhome-session-archive.test.tsto pin the new behaviour (caches survive archive, no tab-removal event fired) — both passpackages/appsuite: 646 pass; the remaining failures (terminal,comments,desktop-native,prompt-submit) reproduce on a cleanorigin/devcheckout and are unrelatedbun turbo typecheck— 30/30 packages greenScreenshots / recordings
No visual change — the fix removes behaviour (tab churn on archive) rather than changing how anything renders.
Checklist
Do less!