You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make the editor tab and Run agree on which server a query goes to #788
Severity: P1 (misleads the user about which server a statement runs on)
What happens
Open ?mock=connected ("Local dev" connected, one "Untitled Query" tab).
Click + ("Connect to a server") and choose "Production (read-only)".
The existing "Untitled Query" tab is silently moved to Production: it now shows a red production dot and a red underline.
Click the "Local dev" connection tab. The editor tab still shows the red Production markers, while the query toolbar and status bar say "Local dev — 127.0.0.1:3306 · DEV".
Type SELECT DATABASE(); and press Ctrl+Enter. It runs on Local dev.
The tab's colour and production dot say one server, while Run uses another. In the reverse case, a tab that looks like dev can run against prod.
Cause
src/components/layout/ConnectionTabs.tsx:164-168: handleConnectProfile calls setTabConnection on the active editor tab, which re-targets it to the new connection.
Execution uses the global selectedConnectionId, not the tab's connectionId: src/components/editor/SQLEditor.tsx:168 and :204, src/hooks/useQueryExecution.ts:25-39.
The editor tab's colour and production dot come from tab.connectionId: src/components/editor/EditorTabs.tsx:186-191.
Fix
Use a single source of truth. Either run against tab.connectionId and have selecting a connection tab switch to (or open) one of its editor tabs, or derive the editor tab's markers from the connection that will actually run the query. Connecting a new server should open a new editor tab, not re-point the current one.
Activity
fix(editor): run on the server the tab shows
fix(editor): run on a SQLite file once opened
test: give the browser test's editor a cursor
release: 1.4.0 (#871)