Skip to content

fix(ui): Fix session recovery dialog appearing on every launch#116

Merged
eyelock merged 1 commit into
mainfrom
fix/session-recovery
Apr 12, 2026
Merged

fix(ui): Fix session recovery dialog appearing on every launch#116
eyelock merged 1 commit into
mainfrom
fix/session-recovery

Conversation

@eyelock
Copy link
Copy Markdown
Owner

@eyelock eyelock commented Apr 12, 2026

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_ID at 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 TerminalCardMetadata to its own file (TerminalCardMetadata.swift) to keep TmuxManager.swift within lint limits.

Testing

  • make check passes (47 warnings, 0 serious, 562 tests pass)
  • Logging audit: no privacy violations
  • Localization: no new strings introduced

Verification steps

  1. Build debug build, create terminals, quit
  2. Launch production build → no recovery dialog for debug sessions (cross-build fix)
  3. Delete a card that has a tmux session, quit, relaunch → no dialog for that session (deleted-card fix)
  4. Dismiss a session, quit, relaunch → session does not reappear (persistent dismissal fix)
  5. "Dismiss All", quit, relaunch → none reappear

Fixes the persistent recovery dialog annoyance reported in the implementation plan.

🤖 Generated with Claude Code

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>
@eyelock eyelock merged commit 97880e4 into main Apr 12, 2026
8 checks passed
@eyelock eyelock deleted the fix/session-recovery branch April 12, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant