Skip to content

[P1/bug] Failed queries with no active connection record as 'Unknown' connection #328

Closed

Description

@EVWorth

Context

resultStore.doExecuteQuery (src/stores/resultStore.ts:181-219) records history entries even when the connection lookup fails. Line 191: const connectionName = conn?.name ?? "Unknown";.

Problem

When doExecuteQuery is called with a connectionId that doesn't exist in activeConnections (e.g., the connection was dropped between the toolbar click and the IPC, or the user called disconnect mid-execution), the conn lookup returns undefined and the entry is recorded with connectionName: "Unknown". The history then shows entries attributed to a non-existent "Unknown" connection — confusing for users trying to clean up. A user with 50 "Unknown" entries has no way to know which connection they originated from.

Files

  • src/stores/resultStore.ts:181-219

Expected

A query that fails because the connection was dropped mid-execution does NOT appear in the history panel; the existing successful-query path still records the connection name correctly.

Proposed fix

Scope S — refuse to record history if the connection is gone: add if (!conn) return early in both the catch path AND success path of doExecuteQuery. Failed lookups leave no trace.

Acceptance

A query that fails because the connection was dropped mid-execution does NOT appear in the history panel; the existing successful-query path still records the connection name correctly.

Needs human verify

yes

Activity

  1. added
    audit
    severity/p1
    kind/bug
    area/history
    on Jul 31, 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/historyauditkind/bugseverity/p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions