Skip to content

fix(client): ignore stale SQL parser results - #2847

Open
HandSonic wants to merge 2 commits into
OtterMind:mainfrom
HandSonic:fix/sql-parser-latest-request
Open

HandSonic wants to merge 2 commits into
OtterMind:mainfrom
HandSonic:fix/sql-parser-latest-request

Conversation

@HandSonic

@HandSonic HandSonic commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Related issue

N/A - no matching issue was found.

Summary

SQL parser responses had no ownership over the current editor model/SQL/database. Older responses could overwrite statements, markers, completion, decorations, and hints, while single-statement execution paths could read stale statement refs during the debounce window. This change adds scoped parser generations, clears invalidated state, requires every single-statement entry to await a committed quick parse, and binds toolbar/shortcut execution to trigger-time selection and cursor snapshots.

Affected surfaces

  • Frontend / Web
  • Backend / API / Storage
  • Database plugin / Driver
  • JCEF / Desktop packaging
  • CI / Build / Release
  • Documentation only

Verification

  • Commands and results:
    • Ownership/execution tests passed for reverse completion, empty/unmount, DB/model/ABA, stale toolbar/quick execution, and cursor/selection movement during deferred parsing.
    • SQL completion plus related execution snapshot, Monaco, and shortcut contracts: passed.
    • Targeted ESLint: passed.
    • Full Community prebuild, Webpack, and production bundle verifier: passed.
    • Fork code and CodeQL checks: passed.
    • Merge-tree with fix(sql-parser): load cross-db table columns for the identifier's db/schema #2482 and this repair batch: passed.
  • Manual verification: N/A - deferred parser promises model all response orders without a browser.
  • UI evidence: N/A

Risk and compatibility

  • Public API or stored data: No API or stored editor data changes.
  • Database or driver compatibility: N/A.
  • Network, privacy, or security: Prevents executing a statement parsed from obsolete editor content.
  • Community / Local / Pro boundary: Shared Community SQL editor.
  • Backward compatibility: Latest parser results preserve existing statements, markers, and hint behavior.

Reviewer map

  • Start here: SqlParserRequestCoordinator, handleSQLParserRightNow, and both single-execution handlers.
  • Failure condition: stale parser side effects commit or any execution path reads refs before a committed parse.
  • Rollback or disable path: Revert commit 7d9989f9c6806fcf6da6244fda994ad8fffb25d0; no migration is required.

Contributor declaration

  • I linked the Issue that defines this change.
  • I tested the affected behavior and reported the actual results above.
  • I did not include credentials, private data, or generated build output.
  • I disclosed substantial AI assistance below, or this PR contains no substantial AI-generated code.

AI assistance: OpenAI Codex assisted with diagnosis, implementation, deterministic tests, verification, and adversarial review.

Latest-main revalidation (2026-09-04)

  • Rebased onto upstream 144a04e; current head 7d9989f.
  • Explicit parser-owner and SQL completion tests passed; targeted ESLint passed.
  • Included in a 10-PR combined Community prebuild, Umi/Webpack production build, and bundle verification, all green.

@openai0229 openai0229 moved this to In Review in Chat2DB Community Aug 31, 2026
@HandSonic
HandSonic marked this pull request as draft August 31, 2026 04:07
@openai0229 openai0229 moved this from In Review to In Progress in Chat2DB Community Aug 31, 2026
@HandSonic
HandSonic marked this pull request as ready for review August 31, 2026 04:32
@openai0229 openai0229 moved this from In Progress to In Review in Chat2DB Community Aug 31, 2026
@HandSonic
HandSonic marked this pull request as draft August 31, 2026 05:10
@HandSonic
HandSonic force-pushed the fix/sql-parser-latest-request branch 2 times, most recently from f7b654d to ac1c0b6 Compare August 31, 2026 06:02
@openai0229 openai0229 moved this from In Review to In Progress in Chat2DB Community Aug 31, 2026
@HandSonic
HandSonic force-pushed the fix/sql-parser-latest-request branch from ac1c0b6 to 3750b0a Compare September 3, 2026 08:08
@HandSonic
HandSonic marked this pull request as ready for review September 3, 2026 14:28
@openai0229 openai0229 moved this from In Progress to In Review in Chat2DB Community Sep 3, 2026
@HandSonic
HandSonic force-pushed the fix/sql-parser-latest-request branch from 3750b0a to 7d9989f Compare September 3, 2026 21:07
Align existing OtterMind/Chat2DB PR OtterMind#2847, retaining its focused behavior and current Community contracts.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

2 participants