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
[P1][bug] Switching connections can display schema objects from the previous server #288
SchemaTree accepts a connectionId prop; on change it refetches the database list. But tree expansion, table/views/routines/triggers state, and in-flight IPC responses are keyed only by database name.
Problem
Two connections with overlapping database names (common — most servers have mysql, app, etc.) will show objects from the previously-shown connection. Context-menu actions (Drop, DDL, SELECT TOP N) execute against the wrong server. Stale IPC responses can repopulate the tree mid-switch.
Files
src/components/schema/SchemaTree.tsx:35
Repro
Connect to Server A, expand app database (has users).
Connect to Server B with a different app database (has orders).
Server B's tree shows users from A, then asynchronously updates.
Expected
Tree state is keyed by connectionId. Switching connections clears stale expansion and rejects late responses for the old connection.
Proposed fix
Scope M. Reset all local state on connectionId change; reject responses for superseded connections; or move all schema state into one connection-keyed schema store (see sch-f7).
Acceptance
Rapid switching between two connections never shows objects from the wrong server, including when old requests resolve late.
Activity
fix(schema): one cache, keyed by connection, and DDL that names its d…
fix(schema): one cache, keyed by connection, and DDL that names its d…