Repository navigation
fix(e2e): let the page settle before the journey answers the welcome tour - #144
Merged
Merged
Conversation
…tour The worker-cf e2e cell failed now and then at "create a project": the click on "Add project" timed out because the welcome tour's backdrop was still in front of the page, although the tour's own PATCH had been answered 200. It failed the main journey on the push to main after #140 (run 43166258556), and the empty-list control on another branch's pull request (43297020745) and on the first dispatch of e2e-schedule.yml (43296974643). The app marks the tour as done in its store at the click and keeps whatever a profile fetch returns after that. The home page fetches the profile as it mounts, so an answer made before the click and landing after it puts the tour back for good. A fast machine does not make that fetch before the click; a CI runner does. - e2e/journeys: the journey waits for what the page asked for to be answered before it answers the tour, and again after, and requires that the tour's button is gone. The wait is watchPending(page).quiet() in support/network.ts, because waitForLoadState("networkidle") resolves at once on a single-page app past its first load. - e2e/support/controls.ts: a new control, slow-page, the one run that must PASS: the browser's CPU slowed 6x and the profile answer of the home page held until the tour's PATCH leaves the browser (2 s at most), then answered as it was before. It fails CONTROL INERT if it held nothing. - scripts/e2e.sh: must_pass, the runner of a control that must pass, held to the exit status and then the count guard; `controls` runs slow-page with it. - docs: G-31, X18 and the technique page say what the race was, what reproduced it and what did not, and what is still not seen. Measured locally on worker-cf: the unfixed journey failed 8 of 8 under slow-page, all at the Add project click and with CI's error text; two weaker controls (a CPU slowdown alone, and a fixed 2 s hold on top of it) passed it 8 of 8, so they are not what slow-page is built from. The fixed journey passed slow-page 8 of 8, and the whole cell passed with all its controls. must_pass was run on a stub in its three cases under sh and dash, and a mutant that ignores the journey's status failed that test. Not seen: CI itself after this, and the Plane leg with the changed journey (local only). Refs: #45 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The first version of this fix, which waited for the page to go quiet before the click and asserted after it that the tour was gone, was not enough. It passed the slow-page control 8 of 8 locally, and two dispatches of e2e-schedule.yml on that head succeeded, and then the pull request's own run failed at the assertion (run 43317382522). Its HAR shows why: the held profile fetch began 1070 ms before the click, and GET /api/users/me/ and the profile fetch the app chains to it were about 930 ms apart under the slowdown, which is longer than the 500 ms of quiet the wait asks for, so the wait returned inside the gap and the click was made with the fetch still in flight. A longer pause is no answer: how long the app's own code waits between the two depends on the machine. - e2e/journeys: the journey waits for what the page asked for, answers the tour, waits again for what was in flight at that moment, and looks that the tour's button is gone. If it is back, it answers it again, three answers at most, as a person would, and records `tour-came-back` in the report. A stale answer cannot come twice: nothing is in flight by then. - e2e/support/controls.ts: slow-page hands back the server's own held answer. It had rewritten the held answer to is_tour_completed: false, which also made stale an answer fetched after the click, one a server would not give. - docs: G-31 and the technique page say what the first version missed and how it was found. Measured locally on worker-cf, 8 runs each, slow-page and no other control: the unfixed journey at 6x CPU slowdown failed 8 of 8 at the Add project click (the changed control still discriminates); the wait-only version at 12x failed 8 of 8 at its assertion; this journey at 12x passed 8 of 8, each of them needing its second answer. The whole cell then passed at the default 6x. Refs: #45 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
G-31's "Not seen" said that CI itself had not been looked at. It has now: the pull request's own run and five dispatches of e2e-schedule.yml on head a5bf65b all passed (journey 1 of 1, slow-page ok). The main run never had to answer the tour twice; the slow-page run did in two of the five, so the race fired in CI under the control and was absorbed. It also says what this does not show: before the fix 3 of the 13 runs of the cell that I could find failed at that step, so six clean runs would come by chance about one time in five (an estimate from few counts), and the wait-only first version passed 3 of 4 runs in CI before it failed. Refs: #45 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
aRustyDev
added a commit
that referenced
this pull request
Nov 13, 2026
cargo deny failed on main's push run for #144 (43475094189), and the gate with it, on this advisory (mutation XSS through embedded SVG and MathML, dated 2026-11-12, patched in ammonia >= 4.2.5 for the 4.2 line). ammonia is the sanitiser behind thrust-editor-doc's description_html; thrust-api-v1, thrust-compat-plane and thrust-editor-worker reach it through the `sanitize` feature. The manifest already allows 4, so this is a lockfile change only: ammonia 4.2.4 -> 4.2.5, its version and checksum, nothing else. `cargo update` also moved tempfile's getrandom from 0.4.3 to 0.3.4; that hunk is not part of this change and was put back by hand (`cargo metadata --locked` accepts the result). Checked: - cargo deny 0.20.2 (CI's version, `--locked check`): the lockfile on main fails on RUSTSEC-2026-0533 alone; this one passes advisories, bans, licenses and sources. - cargo nextest run --workspace --profile ci: 3564 passed, 4 skipped (the oracle_ tests the profile excludes), the three sanitiser tests among them. - examples/sanitize_check over the 125 XSS payloads and the editor corpus (431 inputs): the sanitiser's output (plain, stripped and hardened) is byte-identical on 4.2.4 and 4.2.5. Control: 4.0.0 (probes/ammonia-400) differs from 4.2.4 on 7 of the same inputs, so the comparison can see this kind of change. Not shown: that the fix does anything for this configuration. The output does not change on any corpus input, so the corpus does not exercise it; the allow-list adds no math, svg or raw-text tag to ammonia's defaults, so by the advisory's own text this code should not have been affected. Not tested with the advisory's payload. The doctests were not run locally; CI runs them. probes/ammonia-400 still pins =4.0.0 on purpose: a separate workspace with its own lock, never shipped, outside cargo deny's reach. Co-authored-by: Claude Sonnet 5.5 <[email protected]>
aRustyDev
added a commit
that referenced
this pull request
Nov 13, 2026
… again (#148) * test(e2e): print a line when a journey had to answer the welcome tour again Since #144 the journey answers the welcome tour again if the page brings it back (three answers at most), so a green run no longer says whether the race fired. The only trace was the `tour-came-back` annotation in the run's JSON report, which the console reporter does not print: the cell's log of the push run for ec37114 (43494469506) has no trace of it, though that run's slow-page report holds one. - e2e/support/check-report.mjs: after the count line of a run, it prints one `e2e: NOTE: tour-came-back in <report>, "<journey>": <what it recorded> ...` line for each journey that recorded it. It is not a verdict and changes no exit status; the line names the report, so main.json (the race happening on the real run) is told from control-slow-page.json (expected there). - docs: G-31 says where the annotation is, what the line looks like, what it means in each report, and what was counted. Measured on the saved reports of the three main runs after #144 (ec37114, 76347e2, af9e97e): the main run recorded it in none and slow-page in two of the three; with the five dispatches G-31 already counts, 0 of 8 and 4 of 8. The checker prints a line for exactly those reports that hold the annotation. Three synthetic reports (a nested suite whose other annotation type must not print; a skipped journey that holds a note, which the count guard still refuses, the refusal being the last line; a report with no suites) behave as intended, and two broken copies fail the first of them: one that ignores the annotation's type printed 3 lines where 1 is right, one that does not descend into nested suites printed none. Not shown: that the line prints in the cell's own log (it was run on saved reports, not by scripts/e2e.sh), and that a real user meets the race (it was reproduced only in the Thrust build, under a slowed CPU and a held profile answer, and not on the pinned Plane). Refs: #45 Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * docs(testing): record that the tour-came-back line printed in the cell's own log The previous commit said it was not shown that the line prints in the cell's log, because it had only been run on saved reports. It has now been seen in a real cell: a dispatch of e2e-schedule.yml on that head (run 43502938868) has the line after the count line of control-slow-page.json and not after that of main.json. The pull request's own run (43501853057) had none, and its reports hold no annotation, so nothing was due there. With these two runs the main run has needed a second answer in 0 of 10 runs and slow-page in 5 of 10. The sentence that a real user meets the race is not shown stays as it was. Refs: #45 Co-Authored-By: Claude Sonnet 5.5 <[email protected]> --------- Co-authored-by: Claude Sonnet 5.5 <[email protected]>
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.
Refs #45 (closed). The journey had a race that the first run of
e2e-schedule.ymlexposed. This fixes the journey, adds the control that reproduces the race, and records what is and is not known.What was wrong
The
worker-cf e2ecell failed now and then atcreate a project: the click onAdd projecttimed out because the welcome tour's backdrop (bg-backdrop) was still in front of the page, although the tour's ownPATCH /api/users/me/tour-completed/was answered 200.mainafter #140empty-listcontrol (same line)e2e-schedule.ymlempty-listcontrol4 of the 13 runs of the cell I could find failed, 3 of them at that line. I had called the cell green from its pull-request runs alone and had not looked at the pushes to
main. The cell is a gate, so this was also blocking other branches' pull requests.The cause, reproduced
WorkspaceHomeViewshows the tour whileis_tour_completedis false.updateTourCompletedsets it true in the store before its PATCH, andfetchUserProfilereplaces the whole profile with what its GET returned. The home page fetches the profile as it mounts, so an answer made before the click and landing between it and the next click puts the tour back for good, and the click onAdd projectis blocked. That code is the pin's, unchanged (web/ALLOWED-CHANGES), so the same race exists on Plane; the journey clicks within milliseconds of the page appearing, which a person does not.Measured locally on
worker-cf, each run 8 times against one Worker, with theslow-pagecontrol (the browser's CPU slowed, and the first profile fetch from inside the workspace held until the tour's PATCH leaves the browser, 2 s at most, then released unchanged):Add projectclick, with CI's error textThree weaker controls did not reproduce it, which is why
slow-pageis built as it is (details in G-31): a late profile answer on a fast machine (the page makes no profile fetch before the click there), a CPU slowdown alone (the answer arrived 800 ms before the click), and both with a fixed 2 s hold (the answer landed 1.3 s after the click).The first version of this fix was not enough, and CI said so
It waited for the page to go quiet (500 ms with nothing in flight) before the click and asserted afterwards that the tour was gone. It passed
slow-page8 of 8 locally and three dispatches ofe2e-schedule.ymlon that version of the fix succeeded, and then this PR's own run 43317382522 failed at the assertion. The HAR from that run: the held profile fetch began 1070 ms before the click, andGET /api/users/me/and the profile fetch the app chains to it were about 930 ms apart under the slowdown, longer than the 500 ms of quiet, so the wait returned inside the gap. A longer pause is no answer: how long the app's own code waits between the two depends on the machine. (Thelintfailure on that run was unrelated: the branch lacked #143's clippy fix, andmainis merged in.)What this changes
tour-came-backin the report. A stale answer cannot come twice: nothing is in flight by then. The wait iswatchPending(page).quiet();waitForLoadState("networkidle")resolves at once on a single-page app past its first load, so it cannot stand in.slow-page, a control that must pass, the only one that does:scripts/e2e.sh controlsruns it through a newmust_pass, held to the exit status and then the count guard. It fails asCONTROL INERTif it held no profile answer.Checked
passed 1 of 1, the four must-fail controls fire,slow-pagepasses,VERDICT: PASS.must_passrun on a stub in its three cases (journey fails; journey passes and the count guard refuses; both pass) undershand under dash inubuntu:24.04; a mutant of it that ignores the journey's status fails the test.tsc --strict(the package has no check of its own; the same invocation reports a planted error).Seen in CI (head
a5bf65b)web);lint, the e2e cell andgateare success.e2e-schedule.ymlon the branch, one after the other (43322146663, 43322945396, 43323732660, 43324516416, 43325211639): allVERDICT: PASS, journey 1 of 1,slow-pageok, nothing skipped but the oracle-onlyuvinstall.slow-pagerun did in two of them, so the race fired in CI under the control and was absorbed.Not seen
mainis red at the cell on 3 of its last 5 pushes until this lands (130c1e9, 84dcafa, 594365d).AuthenticationWrapperis the guess; nothing here tested it.down -vdrops the seeded snapshot). Say if you want it.🤖 Generated with Claude Code