Skip to content

fix(connections): ask before closing drops an open transaction - #3272

Merged
datlechin merged 1 commit into
mainfrom
fix/confirm-close-open-transaction
Oct 6, 2026
Merged

datlechin merged 1 commit into
mainfrom
fix/confirm-close-open-transaction

Conversation

@datlechin

Copy link
Copy Markdown
Member

Why

Closing a database entry, Close Connection, Cmd+W on a connection with no tabs, and Disconnect closed the connection without reading its transaction state, so the server rolled back an open transaction silently. Since #3271 a PostgreSQL entry left in the background can hold one.

Change

  • databasesHoldingTransaction(for:among:) reads the browsed connection and every parked one, at most 1 s each. A late answer is dropped, not cancelled. In-transaction and aborted states count; a connection running a statement is skipped.
  • Closing an entry, closing the connection and disconnecting ask first with a destructive alert naming the databases. Cancel changes nothing. The question comes before the unsaved-changes prompt.
  • Cmd+W on a connection with no tabs goes through Close Connection instead of its own copy.

Verified

ConnectionCloseActionTests, ConnectionDisconnectActionTests, SessionLanesTests (open, aborted, held turn, a read that never answers, a late read not cancelled) and the close suites: 77 passed. A UI test would need a live server with a typed BEGIN.

Not in this PR

Quit, the MCP disconnect tool, renaming a database and the PGlite database switch still end a transaction without asking.

@mintlify

mintlify Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
TablePro 🟢 Ready View Preview Oct 6, 2026, 7:47 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

@datlechin
datlechin merged commit fdc12ea into main Oct 6, 2026
16 checks passed
@datlechin
datlechin deleted the fix/confirm-close-open-transaction branch October 6, 2026 10:02

This branch was successfully deployed

1 active deployment
staging - docs — 07dabeab Deployed Oct 6, 2026 by mintlify[bot]
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