Skip to content

[P1][bug] resultStore.ts:163 swallows successful results when the cancel generation mismatches #287

Closed

Description

@EVWorth

Context

resultStore uses a generation counter to ignore late execute_query responses for cancelled queries.

Problem

If the user clicks Cancel, then issues a new query before the old one's response arrives, the new query's response can be discarded if the race is unfortunate — set checks generation and drops the result. The result is gone from both stores; user sees an empty grid.

Files

  • src/stores/resultStore.ts:155-180 (generation check)

Repro

  1. Run a slow query that resolves in ~1s.
  2. Click Cancel within 100ms.
  3. Run another query.
  4. The first response can arrive after the second and clobber or be dropped; second query's result is lost.

Expected

Generation cancellation only ignores the cancelled query's response, not subsequent queries.

Proposed fix

Scope S. Track per-query generation; cancel only discards the specific query_id's response. Or: a "latest" flag that only discards if the new query has not yet started.

Acceptance

Cancel + immediate re-query never drops the new query's result.

Needs human verify

Yes (race timing).

Activity

  1. added
    audit
    severity/p1
    kind/bug
    area/editor
    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/editorauditkind/bugseverity/p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions