Repository navigation
test(link): pin the Child relay wait observer across Home failures, queued aborts and cancels, and correct its comments - #8683
Merged
Conversation
…e and ends with the relay
…bort with a queued chunk, and a cancel that reaches the Home
Contributor
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Contributor
|
✅ Deterministic PR hygiene checks passed. |
…nce the relay has handed over its held chunk
…relay ends, and never reports true again
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 13, 2026
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.
Summary
Follow-up to #8680 (the Child HTTP relay's test-only wait observer), from its final review. Comments, tests and one structure sentence; no code changes.
Comments.
src/client/link-websocket-limits.tsand the test header now say:The observer comment also says it reports false when the reader cancels, and never reports true again once the relay has ended. The
waitObservationcomment insrc/client/link-relay.tssays that an unread Home failure keeps the relay waiting while it holds that chunk and its request, until its next read, a reader cancel, a caller abort or (SSE) the idle limit ends it.Tests (
tests/clients/link-relay-wait-observer.test.ts), driven by a Home body the test answers read by read. It has a high-water mark of 0, so every read the relay makes is a pull the test waits for before it sends a chunk or a failure. No sleeps, timers or polling.[true, false], and the reader's next read fails.[true, false, true, false]; the reader's next read then fails. That order held in 50 runs of the case.[true, false], the Home body is cancelled, and nothing the reader does afterwards reports a wait again. The ordinary-body path has no hook that shows a chunk queued, so the two queued-chunk cases run on SSE only. The case where the Home fails while the relay reads it runs on both.Structure. In
structure/remote-link.md, the sentence after the Child relay's signal now starts "On the Home, ...", since it describes the Home's waits.What keeps it inert: no runtime code changes. The observer stays
nullin production, as before.Tests and how they were checked
These tests pin behaviour that #8680 already has, so they pass on the base. To show they are not vacuous, I ran two mutations on a scratch copy of
src/client/link-relay.tsand restored the file afterwards:bodyCleanup = cleanup): ata3f8ccbd8, 8 of 12 cases failed, including both new "fails after one chunk" cases and the new queued-chunk abort case. After its last change, the unread-failure case, run alone under the same mutation, also fails (a timeout at its fourth event);home.cancelled().Verification
bun test tests/clients/link-relay-wait-observer.test.ts, 5 runs in a row: 12 pass, 0 fail eachbun run typecheck: exit 0;bun run privacy:scan: exit 0;bun run structure:check: exit 0TMPDIR=/tmp bun scripts/test.ts --parallel=2overlink-relay-wait-observer,client-link-relay,link-trafficandlink-boundary(undertests/clients/),tests/test-layout.test.ts,tests/test-layout-tooling.test.tsand the file-size, structure and import-cycle ratchets: exit 0, 183 pass, 0 fail (ata3f8ccbd8); at the final head, overlink-relay-wait-observer,client-link-relay,link-boundaryand the file-size and structure ratchets: exit 0, 118 pass, 0 failReview: gpt-6.1-terra at xhigh, read-only, two rounds with the same reviewer. Round 1 found that the queued-chunk cases failed or aborted while the second chunk was still in flight, before the relay had queued it (P2). It is fixed with the idle-timer sync point above. Round 2 had no findings. The final review (approve with nits) found the unread-failure case's checks too loose to fail when the relay misbehaves, and two comments incomplete. All three are fixed in the last three commits, which the coordinator read in place of another terra pass. Open P0-P2: 0.
NOT RUN: the full suite, macOS and Windows.
Checklist