Repository navigation
adopt(superset-sqllab): ready to send: SQL Lab autosave loses edits typed while a save is in flight - #160
Open
MeharPro wants to merge 1 commit into
Open
adopt(superset-sqllab): ready to send: SQL Lab autosave loses edits typed while a save is in flight#160MeharPro wants to merge 1 commit into
MeharPro wants to merge 1 commit into
Conversation
Race hunt on Apache Superset's SQL Lab (master 730016b8), GenClass injected from outside. EditorAutoSync marks editors saved at the time the PUT /tabstateview response arrives, so an edit typed while the save is in flight is never sent and a reload brings back the old SQL. Explore reported it at 600 and 900 ms and its replay reproduced it; a plain Playwright script reproduces it 3 of 3 at 600, 900 and 1,500 ms (0 of 3 at 0 and 300). Report, three patches against Superset (autosave, Format SQL overwriting typed text, Save query double submit), each with a Jest test failing 3 of 3 before and passing 3 of 3 after, the issue and pull request drafts, and the harness with its results. Nothing sent upstream. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fqwfq395igZzHpFL8xVqS6
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Status: ready to send (after the sender's by-hand items in
docs/adoption/hunts/superset-sqllab-issue.md, "Before sending").What
A race hunt on Apache Superset's SQL Lab (master
730016b8, run natively, GenClass injected from outside).EditorAutoSyncmarks editors as saved at the time thePUT /tabstateview/<id>response arrives. An edit typed while that request is in flight therefore counts as saved, is never sent, and a reload brings back the old SQL. Explore reported it (RACE 2 of 6 at 600 ms, 3 of 6 at 900 ms, on exactly the loads whose server copy lost the edit) and its replay reproduced it. A plain Playwright script reproduces it 3 of 3 at 600, 900 and 1,500 ms (0 of 3 at 0 and 300 ms). Two smaller bugs of the same family the brief predicted were also confirmed and fixed, each as its own patch: Format SQL overwrites text typed while formatting, and the Save query modal saves twice on a double click.Only files under
docs/adoption/hunts/are added or changed; nothing inpackages/.Files
docs/adoption/hunts/superset-sqllab.md: the report (setup, scenarios and verdicts incl. negatives, the finding in causal order, root cause, fixes, tests, fixed variant, problems with GenClass, time).docs/adoption/hunts/superset-sqllab.patch: the autosave fix plus a Jest regression test (git format-patch; applies at730016b8and at the brief'sf44d3992).docs/adoption/hunts/superset-sqllab-format.patchandsuperset-sqllab-savequery.patch: the two secondary fixes, each with its test.docs/adoption/hunts/superset-sqllab-issue.md: the issue (Superset's bug-report form), the pull request (Superset's template), the optional Format SQL issue and PR, the disclosure paragraph and the "before sending" checklist.docs/adoption/hunts/superset-sqllab/: harness (hunt.mjs,repro-autosave.mjs,repro-format-save.mjs,lib.mjs,summarise.mjs) andresults/{unfixed,fixed}/(tool texts and summaries, each file under 25 KB).docs/adoption/hunts/README.md: the row.To send (a person, from a personal account, after the owner's go-ahead)
superset-sqllab-issue.mdthrough the bug-report form (fields map one to one).git am docs/adoption/hunts/superset-sqllab.patchon a branch from master, set yourself as author, keep theGenerated-by: Claude Codetrailer, read the diff, then runnpm run test -- src/SqlLab/components/EditorAutoSyncwith and without the fix andpre-commit runon the staged files.fix(sqllab): keep editor changes made while the tab state is being saved) with "Fixes #". Superset keeps PRs open at least 24 h and needs CI green plus one approval. Answer review yourself.Measured (every number with its M and latencies)
slow_ms300/600/900, 2 baselines + 6 seeds eachFalse reports: on the fixed build, 0 of 72 explore loads had any bug by the harness's own oracle, but 4 of 9 fixed sessions still carried a RACE line. On the unfixed build, the verdict was right in 6 of 9 sessions.
Problems with GenClass itself (report section 7)
slow_msexplores "response before or after the user's next keystrokes", but the docs describe only reordering.identical-in-flightwitness for the Save query double submit (16 of 18 seeded loads sent two identical POSTs).Checks
npm run typecheck -w @genclass/runtimeandnpm run build -w @genclass/runtimepass: build run (the harness usesdist/); typecheck not run separately, since no runtime source changedpackages/runtime/test/review-*.test.tswas editedsim/anddemos/not touchedxlsxworkaround stayed in the Superset clone, out of every patch)Notes for the reviewer
superset-sqllab.mdsections 3 (the tables), 4 (the finding) and 7 (GenClass problems) first.claude/beautiful-einstein-5r1xn0rather thanadopt/superset-sqllab.oxfmt,oxlint, custom rules,type-checking-frontend(afternpm run plugins:build), all passed; everysrc/SqlLabJest suite: 47 suites, 526 passed, 1 skipped.xlsxrepointed to an npm mirror becausecdn.sheetjs.comis blocked by this container's proxy;zstdinstalled for the build.Generated by Claude Code