Repository navigation
Stop reporting gallery sample cancellation as an error - #2388
Merged
Merged
Conversation
leaf-agent
previously approved these changes
Oct 11, 2026
Main's vulture hook, which arrived beside #2345, flags it; pluggy passes a hook implementation only the arguments it names. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
previously approved these changes
Oct 11, 2026
leaf-agent
previously approved these changes
Oct 11, 2026
leaf-agent
approved these changes
Oct 11, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 12, 2026
…departure its own error (#2501) A gallery sample whose document reloaded while the gallery was loading left the demo on a disabled "Loading…" for good. The gallery had swallowed every `AbortError` since #2388, and `sample.js` used `AbortError` both for its owner's own cancellation and for the child document departing, so the gallery treated a reload as if it had cancelled the load itself. Nothing ever sent `gallery.configure` to the reloaded document. The same was true of a reload after loading: the toggle kept its old word, and pressing it reached an unconfigured child. **Review item 20 (Lit follow-up round).** What changed: - `sample.js` now rejects `ready` and calls with `AbortError` only when the host's owner cancels them (destroy, or a reset replacing the allocation). When the child document departs, through an authored navigation or a reload, they reject with a new `SampleDepartedError`. A call aimed at a document that is gone rejects with the reason its connection closed, which replaces the mixed "sample unavailable" `AbortError`, and a child failure that retires the allocation rejects pending calls with that failure. A departure still leaves the browser's destination in the frame rather than retiring the allocation. The header states the contract. - The interaction gallery configures every document the sample presents: the first, and each one a reload announces with `loading`. While a document is gone, the toggle reads "Loading…". Only real failures show "Could not play". - `lf-sample` treats a departure as its departed notice already draws it, and doesn't report it as a failure. `page-authoring.md` names `SampleDepartedError` and says `lf-sample-ready` fires again after a reload. The new browser test reloads the sample document during the gallery's load and again after it, and plays each time. On `main` it stops at "Loading…"; here it plays. The native-departure test now expects `SampleDepartedError` where it expected `AbortError`. Line deltas (from `git diff --numstat`): hand-written source +99 / −56 (net +43) across `interaction-gallery.js`, `sample.js` and `lf-sample.js`. Tests +30 / −3 (net +27). > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[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.
Closing or navigating away from the gallery while a sample is loading could report
sample destroyedas a page failure. Sample cancellation can occur while the old figure remains connected, so the gallery now follows the sample owner's AbortError contract for loading and playback commands, as lf-sample already does.This is a finishing follow-up to survey item 14, found while verifying the final preview. Runtime source measures 340 → 341 lines (+1, including the cancellation contract comment); the browser regression adds 29 lines.
Validation: the held-allocation departure regression fails before the fix with "Could not play" and a page error, then passes after it. After integration with main, that regression and the phone diff-header journey pass, along with all 336 runtime tests. Independent source and integration reviews found no issues. CI runs the complete landing gates.
CI also exposed a synchronization race in the retry regression introduced by #2365: observing a browser request precedes its Python route callback. The two held retry steps now wait for the collected route through the existing
holdinghelper before reading the attempt count. All count and focus assertions remain; the focused retry journey passes. The diff-controls test module stays 521 → 521 lines.