Repository navigation
Reopen Last Session drops connections that were on the strip but not connected #3658
Description
What happened?
Reported in #3551. With Reopen Last Session on, quitting from the Dock and opening TablePro again brings back only the connections that were connected at quit. An entry that sat on the connections strip without a live connection is gone after the relaunch.
The screen recording in #3551 shows it. The strip holds three connected entries (two MySQL, one Redis). The user opens a fourth MySQL connection from the connection switcher and presses Cancel while it connects. The entry stays on the strip as Not Connected with a Connect button. After Quit from the Dock and a relaunch, the strip has three entries.
What the code does today:
- The recovery list keeps a connection only when its coordinator was activated or its workspace phase keeps restore intent (
apple/TablePro/Core/Storage/RecoveryConnectionList.swift:18). ConnectionWindowPhaseMachine.retainsRestoreIntentreturns false for.unavailable(.cancelled),.unavailable(.disconnectedByUser)and.idle(apple/TablePro/Core/Services/Infrastructure/ConnectionWindowPhaseMachine.swift:121).SessionRecoveryTracker.connectionIds()also drops a connection the user disconnected (apple/TablePro/Core/Storage/SessionRecoveryTracker.swift:29).LastOpenConnections.jsonstores only those ids (apple/TablePro/Core/Storage/LastOpenConnectionsStorage.swift:31), andreopenLastSession()opens exactly that list (apple/TablePro/Core/Services/Infrastructure/LaunchEnvironment.swift:171).
Dropping a canceled connect has been deliberate since 0.57.1 (#1358), so a relaunch never dials a host the user gave up on. But the strip keeps the entry for the rest of the session, and features/tabs.mdx ("What survives a restart") only says that a connection that cannot be reached stays in the next session's list. Nothing tells the user that a canceled or disconnected entry will not come back.
Steps to reproduce
- In Settings > General, set When TablePro starts to Reopen Last Session.
- Open two or three connections so each one is on the connections strip and connected.
- Open one more connection from the connection switcher and press Cancel while it connects. Its entry stays on the strip as Not Connected.
- Quit TablePro from the Dock menu (or press
Cmd+Q) without closing the window. - Open TablePro again.
The same happens with an entry you disconnected from the strip in step 3 instead of canceling.
Expected behavior
Every entry on the connections strip at quit comes back after the relaunch, in the same order. An entry that was not connected at quit comes back as Not Connected and does not dial, so #1358 stays fixed. A test covers a relaunch with several connections, one of them canceled and one disconnected.
Database type
MySQL / MariaDB
TablePro version
Not stated in #3551. The report is dated 2026-10-18, after 0.81.0 and before 0.82.0 shipped. The code above is unchanged on main after 0.82.0.
Platform
macOS
OS version & hardware
No response
Screenshots / Logs
Screen recording attached to #3551.
Activity