Repository navigation
feat(editor): give each editor tab its own server session - #734
Merged
Merged
Conversation
A tab's statements went to whichever pooled connection was free, so anything tied to the session -- SET @var, SET SESSION, a temporary table, a transaction begun in one run and committed in the next -- could land on a connection where it did not exist, and silently not be there (#731). Other clients bind a tab or console to one session. Backend: ConnectionManager keeps per-tab sessions, one-connection pools opened on the tab's first statement and never recycled while it is open (no idle timeout, no max lifetime), with the same session setup as every lane. Route::Session sits beside the lanes; execute_query and explain_query take an optional session, and close_session ends one -- the server rolls back what the tab left uncommitted. Disconnect closes them all. Cancel still reaches a tab's statement (KILL QUERY leaves the session alive). A busy tab now says so instead of "pool timed out". The interactive-lane message says "queries" rather than "editor queries", since the editor no longer runs there. Frontend: the editor passes the active query tab's id as its session, through execution, the production confirmation, paging and explain. lib/server-sessions.ts ends a session when its tab closes or moves to another connection, from one editor-store subscription that starts with the first session. Everything that is not an editor tab still runs on the shared pool. Step 2 of #731. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_019uLE7rJcohc7WDPstJ7yCL
…r test The SQLEditor browser test pinned the old three-argument call. The action now passes the active query tab's id as its session (#731), with no format of its own. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_019uLE7rJcohc7WDPstJ7yCL
This was referenced Sep 25, 2026
Merged
EVWorth
added a commit
that referenced
this pull request
Oct 5, 2026
Version bump across the three manifests and the two lockfile entries that record the app's own version. What 1.2.0 contains since 1.1.0: - Each editor tab runs on its own server session, so SET @var, temporary tables and multi-run transactions carry across runs (#734) - Separate connection lanes for the agent and for backups/restores, so neither can starve the editor; the pool-exhausted message says what is holding the pool (#732, #727) - Copy button beside Expand for long cell values, such as SHOW CREATE TABLE (#748) - Linux/Wayland: WebKitGTK's DMABUF renderer is turned off, for the black area left after resizing the window (#742) - Tauri 2.12 on both the npm and Rust sides (#749), and the dependency roll-up in #740 - rustls TLS 1.3 advisory RUSTSEC-2026-0285 patched (#728) Also the first release built with rustup in place of dtolnay/rust-toolchain (#746), so the release jobs' toolchain step runs on Windows and macOS for the first time. Claude-Session: https://claude.ai/code/session_01SCNjpC4VgppHSFs7P6rkZg Co-authored-by: Claude <[email protected]>
This was referenced Oct 18, 2026
Merged
EVWorth
added a commit
that referenced
this pull request
Oct 20, 2026
* release: 1.3.0 Version bump across the three manifests and the two lockfile entries that record the app's own version. 1.2.0 and 1.2.1 were bumped but never tagged, so 1.3.0 is the first release since 1.1.0 and carries everything since it: Connections (#731) - Each editor tab runs on its own server session, so SET @var, SET SESSION, temporary tables and multi-run transactions carry over (#734) - Each agent session, and each backup or restore, has connections of its own, so none of them can hold up the editor or each other (#732, #770) - The Min/Max pool size setting and the status-bar pool counter are gone; connections are no longer something to size (#769) - A "busy" error says what is busy and what to wait for (#727) Grid - Grid edits save on the tab's session without committing its open transaction (#762) - Copy a long cell value without opening the viewer (#748) Fixes - Linux: WebKitGTK's DMABUF renderer is off under Wayland (#742) - rustls for RUSTSEC-2026-0285 and RUSTSEC-2026-0346..0349 (#728, #759) - Tauri 2.12.3, tauri-plugin-updater 2.13.3, tauri-plugin-shell 2.5.0 (#749, #747, #758), and dependency roll-ups Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g * fix(deps): bump rustls-webpki and webpki-roots for RUSTSEC-2026-0381..0383 rustls-webpki 0.103.16, webpki-roots and webpki-root-certs 1.0.10. The advisories were published today: certificate verification could accept distrusted intermediates, and the bundled roots still trusted the distrusted emSign intermediates. cargo audit fails on all three, and a release should not ship them. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g --------- Co-authored-by: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 2 of #731.
Problem
An editor tab's statements went to whichever pooled connection was free. So anything tied to the server session could land on a connection where it didn't exist, and silently not be there:
SET @varandSET SESSION …DBeaver, DataGrip, Workbench and pgAdmin all bind a tab or console to one session.
Shown, not assumed: the new live tests fail against the old routing. With sessions pointed back at the shared pool, 7 of the 9 fail: the temporary table is gone, the transaction doesn't span runs, the variable leaks between tabs, and so on.
Change
Backend
ConnectionManagerkeeps a session per tab: a one-connection pool, opened on the tab's first statement. It is never recycled while the tab is open (no idle timeout, no max lifetime), since recycling it is exactly the state loss this fixes. It uses the same session setup as every lane, so its threads count as the app's own.Route::Session(tab)sits besideRoute::Lane(..).execute_queryandexplain_querytake an optionalsession. Explain has to run on the session too, orEXPLAIN SELECT … FROM tmpcan't see the tab's temporary table.close_sessionends a tab's session. The server then rolls back anything the tab left uncommitted, as closing a tab does in any client. Disconnect closes every session.KILL QUERYleaves the session alive, so the tab keeps its state.Frontend
lib/server-sessions.tsends a session when its tab closes or moves to another connection. It uses oneeditorStoresubscription, which starts with the first session, rather than a call in each of Close, Close Others, Close to the Right, the last-tab replacement and connection switching.session, since it has no server sessions.Behaviour to know
USE: the tab's database selector still wins. Each run starts withUSE <tab database>as before, so aUSE othertyped in an earlier run is reset on the next one.Verification
Run locally against MySQL 8.0 and MariaDB 11:
tests/editor_sessions.rs(9 live tests):COMMIT;close_sessionrolls back and releases row locks;EXPLAINsees the tab's temporary table;just test-integration: passes on both servers.cargo fmt --check,cargo clippy --all-targets --all-features -D warnings,just test-rustand the bindings regeneration all pass.bindings.tschanges only by the newsessionparameters andcloseSession.tsc,dprint checkandeslint(0 errors; the 162 warnings were already there) pass, and vitest has 2970 passing tests. New tests:lib/__tests__/server-sessions.test.ts: close rules, plus a realcloseTabending the session;resultStore: paging, confirmation and explain keep the session.--no-verify: the lefthookunit-testshook fails locally only onsrc/__tests__/main.test.tsx, a 10s hook timeout. It fails identically on untouchedmainin this environment and passes with a longer timeout (4/4 in 15s). CI's Test Frontend is the check that counts.🤖 Generated with Claude Code
https://claude.ai/code/session_019uLE7rJcohc7WDPstJ7yCL
Generated by Claude Code