fix(ui): Fix session recovery dialog appearing on every launch#116
Merged
Conversation
Three bugs caused the recovery dialog to show sessions that should never have been surfaced: - Cross-build contamination: debug and release builds share one tmux server, so each build saw the other's sessions as orphans. Fixed by tagging every new session with TERMQ_BUNDLE_ID and filtering on list. Untagged (pre-existing) sessions are still shown for backwards compat. - Deleted cards: soft-deleting a card preserves the tmux session, but recovery matching excluded deleted cards, turning them into false orphans. Fixed by filtering sessions whose card-ID prefix matches any deleted card before the recovery dialog is shown. - No persistent dismissal: "Dismiss" and "Dismiss All" only suppressed sessions in-memory, so they reappeared on next launch. Fixed by persisting dismissed session names in UserDefaults (scoped per build via the OS bundle-ID domain). Stale entries are cleaned up whenever the check runs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
The session recovery dialog was appearing on every app launch, showing sessions that should have been silently ignored. Three separate bugs contributed to this.
Changes
Cross-build contamination: debug and release builds share one tmux server, so each build saw the other's orphaned sessions. Each new session is now tagged with
TERMQ_BUNDLE_IDat creation time;listSessions()filters to only sessions matching the current build. Untagged sessions (created before this fix) are still shown for backwards compat.Deleted-card sessions: soft-deleting a card preserves the tmux session, but recovery matching excluded deleted cards, so they became false orphans. Sessions whose card-ID prefix matches any soft-deleted card are now silently filtered before the dialog appears.
No persistent dismissal: "Dismiss" and "Dismiss All" only suppressed sessions in-memory, so they reappeared on next launch. Dismissed session names are now persisted in
UserDefaults(scoped per build via the OS bundle-ID domain). Stale entries are cleaned up on each recovery check.Extracted
TerminalCardMetadatato its own file (TerminalCardMetadata.swift) to keepTmuxManager.swiftwithin lint limits.Testing
make checkpasses (47 warnings, 0 serious, 562 tests pass)Verification steps
Fixes the persistent recovery dialog annoyance reported in the implementation plan.
🤖 Generated with Claude Code