Skip to content

feat(ios): show an open transaction on every tab, with Commit and Roll Back - #3688

Merged
datlechin merged 5 commits into
mainfrom
feat/ios-transaction-indicator
Oct 20, 2026
Merged

datlechin merged 5 commits into
mainfrom
feat/ios-transaction-indicator

Conversation

@datlechin

@datlechin datlechin commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Summary

  • A bar on every section of an open connection shows while its session holds a transaction: Transaction Open, the database or connection name, Roll Back and Commit. A failed PostgreSQL transaction shows Transaction Failed with Roll Back only.
  • iOS 26.1+ puts the bar in the tab bar accessory. iOS 18 to 26.0 puts it at the bottom of each screen. Button titles turn into symbols where they do not fit.
  • Commit follows Safe Mode: runs at Off, asks at Confirm Writes, hidden at Read-Only. Roll Back always asks and is never gated. Both act only on the window's own session and refuse when other work ran after the dialog opened.
  • The connection list marks a connection holding a transaction (hourglass, "Transaction open" in VoiceOver).
  • SessionTransactionMonitor owns the state per connection. It refreshes after every run, grid load, row write and table refresh. A session that ends clears it.
  • New DriverTransactionState.abortedTransaction. A grid write joins an aborted or autocommit-off transaction instead of sending its own BEGIN, so MySQL with autocommit off no longer commits pending work on save.
  • PostgreSQL and DuckDB pings no longer send SQL inside a transaction, so returning to the app keeps the session. A typed COMMIT after a failed PostgreSQL statement says the server rolled it back.
  • Reconnects dial the active database and schema, once per connection across iPad windows. A reconnect over an open transaction says what happened to it, and open grids and row screens reload or close. A PostgreSQL or Redshift database switch asks before it drops one.
  • OceanBase and Databend report unknown state (no bar): their status flags are unmeasured.
  • TableProOracleCore: DDL closes the tracked transaction, and asks the server after a failed DDL. The macOS Oracle plugin links it.

Test plan

  • New: SessionTransactionMonitorTests, ConnectionCoordinatorReconnectTests, TransactionIndicatorContentTests. Extended: PostgreSQL, MySQL and DuckDB driver tests, RowInserterTests, QueryEditorViewModelTests, ConnectionListRowModelTests, BottomSafeAreaBarLayoutTests, ConnectionManagerTests, Oracle role and session tests.
  • Changed on purpose: WriteTransactionPolicyTests, DatabaseDriverWriteTests and RowInserterTests (an autocommit-off session is joined, not wrapped), PostgreSQLSessionTransactionTests (INERROR is aborted; ACTIVE reads the status from when the statement was sent).
  • verify.sh: ios (359 tests), package TableProCore and TableProOracle, build OracleDriver, lint, l10n pass.
  • iPhone 18 Pro simulator, iOS 27.0, MariaDB started with --autocommit=0: opening a table shows the bar and the list mark; Commit clears both. The iOS 18 to 26.0 bar is covered by BottomSafeAreaBarLayoutTests only: no older runtime is installed here.
Before After
Table, light Before, light After, light
Table, dark Before, dark After, dark
List, light Before, list, light After, list, light
List, dark Before, list, dark After, list, dark

Part of #3669

Not in this PR

  • macOS indicator, connections strip mark and MCP transaction_control; Linux buttons.
  • iOS DuckDB and SQL Server report no session state, so they show no bar.
  • Saving a connection edit that dials differently drops its transaction without asking.
  • Deleting a connection rolls back its open transaction without asking; the row mark shows it.
  • A fresh open in one iPad window while another redials supersedes the redial and shows a connection error.
  • A typed ROLLBACK does not reload the grid, table list or row screen; the bar's Roll Back does.
  • MySQL autocommit off: a Structure or FK preview read can open a transaction the bar shows only after the next run, write, grid load or table refresh.
  • A database switch in one iPad window leaves the other on its old session, with no bar, until it is next active.
  • Grid page loads do not count as busy: Commit during a PostgreSQL page stream ends that page.
  • Oracle DDL inside EXECUTE IMMEDIATE stays untracked. MySQL Truncate and Drop confirmations do not say they commit pending work.
  • Pre-existing: "No Table Selected" and "Pick a table to browse its rows." are missing from the iOS catalog.

…indicator

# Conflicts:
#	apple/TableProMobile/TableProMobile/Helpers/ConnectionListRowModel.swift
#	apple/TableProMobile/TableProMobile/Views/ConnectedView.swift
#	apple/TableProMobile/TableProMobile/Views/DataBrowserView.swift
#	apple/TableProMobile/TableProMobileTests/BackgroundReleaseCoordinatorTests.swift
#	apple/TableProMobile/TableProMobileTests/ConnectionLibrary/ConnectionListRowModelTests.swift
@datlechin
datlechin disabled auto-merge October 20, 2026 04:33
@datlechin
datlechin merged commit 0df8502 into main Oct 20, 2026
9 of 10 checks passed
@datlechin
datlechin deleted the feat/ios-transaction-indicator branch October 20, 2026 05:11
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