Skip to content

[P1][bug] Switching connections can display schema objects from the previous server #288

Closed

Description

@EVWorth

Context

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

  1. Connect to Server A, expand app database (has users).
  2. Connect to Server B with a different app database (has orders).
  3. 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.

Needs human verify

No.

Activity

  1. added
    audit
    severity/p1
    kind/bug
    area/schema
    on Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/schemaauditkind/bugseverity/p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions