Skip to content

fix(connections): reopen every strip entry, leaving canceled and disconnected ones not connected - #3701

Merged
datlechin merged 4 commits into
mainfrom
fix/3658-reopen-session-strip-entries
Oct 20, 2026
Merged

datlechin merged 4 commits into
mainfrom
fix/3658-reopen-session-strip-entries

Conversation

@datlechin

@datlechin datlechin commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Reopen Last Session brings back every connection on the connections strip, in the order it had at quit.
  • A connection canceled while connecting, or disconnected, comes back Not Connected and does not dial, so Canceling connection does not actually cancel #1358 stays fixed.
  • The relaunched window shows the connection that was on screen at quit, not whichever entry was adopted last.
  • LastSession.json holds the session with a reconnect flag per connection. LastOpenConnections.json keeps its [UUID] format with only the connections that reconnect, so 0.82 still reads it and never dials a canceled one. When the two disagree, the newer file wins.
  • The recovery list is ordered by when each connection opened. It came from two dictionaries, so the strip order after a relaunch was arbitrary.
  • The quit save is final. AppKit closes the windows after applicationWillTerminate, and with no coordinator alive nothing flagged termination, so those closes saved an empty list: a session holding only failed or not-connected connections lost them at quit.
  • The recovery file also updates when an entry joins or leaves the strip, the selection changes, or a window opens or becomes key, so a crash keeps the same list.
  • An MCP open_connection_window or open_table_tab for a connection already on the strip but failed or not connected now dials it, under the same rules as a new window: never one the user canceled or disconnected. It used to queue the open and time out.
  • .claude/rules/connection-window.md: the Reopen Last Session line now states this behavior. data-sync-storage.md lists the two files.
  • RecoveryConnectionListTests changes on purpose: "A cancelled connection attempt is not restored" is now "A canceled connect comes back without dialing".

Test plan

  • LastOpenConnectionsStorageTests (new): a relaunch with four connections, one canceled and one disconnected, comes back in order with only the connected ones dialing; the legacy file holds only reconnecting ids; a legacy-only file reopens everything; an older build's newer list wins; a save cut short keeps the newer session; saves after the quit save change nothing.
  • RecoveryConnectionListTests: canceled, disconnected and never-dialed connections come back with reconnect off; a failed one still reconnects; a closing window is left out; order follows when each connection opened.
  • MainSplitViewControllerPaneSynchronizationTests: a workspace reopened without its connect stays idle on the not-connected pane when its window activates; a connect request reaches it but leaves a canceled one alone.
  • Sandboxed Debug build of this branch, quit through NSRunningApplication.terminate(): a session of three SQLite connections, the middle one saved as not reconnecting, reopened in order with coordinators for the other two only and the saved connection selected, and the same session was written back at quit. A session of two not-connected entries survived a quit that closed its window with no coordinator alive.
  • Main build, same harness: AppKit calls windowWillClose after applicationWillTerminate, so the quit save never sees a closing window.

Docs: TableProApp/docs#64

Fixes #3658

@datlechin
datlechin enabled auto-merge (squash) October 20, 2026 14:59
@datlechin datlechin added the backport release/0.83 Merged into main; pick onto release/0.83 label Oct 20, 2026
@datlechin
datlechin merged commit 3815932 into main Oct 20, 2026
8 checks passed
@datlechin
datlechin deleted the fix/3658-reopen-session-strip-entries branch October 21, 2026 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport release/0.83 Merged into main; pick onto release/0.83

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reopen Last Session drops connections that were on the strip but not connected

1 participant