feat(net): cancel a pending fetchGroup with an AbortSignal - #4546
Conversation
FetchGroupOptions gains `signal`. An abort rejects that caller with the signal's reason and closes only its share; the coalesced FETCH stream is cancelled once the last sharer leaves, including during setup. An already-aborted signal rejects before anything is sent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 13 minutes. View limit detailsLimit details: You’ve used all 4 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (9)
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. Comment |
Codex Review SummaryThis 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. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed head: 02f4172
Direction: useful and proportionate. Reserving each caller's mirror before setup, then abandoning the shared fetch only after the final caller leaves, is the right ownership model. A per-caller AbortSignal should not close the track or cancel another caller's fetch.
No actionable defect found in the changed local/lite fetch paths, abort helper, or setup-abandonment cleanup. The tests cover pre-abort, one surviving sharer, and final-sharer cancellation during TRACK_INFO and FETCH. Keeping cancellation scoped to setup, with callers closing an already returned group themselves, is a clear API boundary.
Verification: static diff and surrounding subscriber/broadcast/track cleanup review; no Bun tests executed.
(Written by OpenAI)
Problem
A
@moq/netcaller could not abandon one pendingfetchGroup()without closing the track or session (the follow-up #4357 left). Implementsquest/m1/js-fetch-cancel.md.Approach
FetchGroupOptions.signal?: AbortSignal, threaded throughbroadcast.ts(local) andlite/subscriber.ts(wire). The IETF path still rejectsfetchGroupand is unchanged.untilAbandoned), so a fetch abandoned during TRACK_INFO never sends its FETCH, and one abandoned while waiting for acceptance resets the stream withCANCELLED. To make that watch valid from the start, the first caller's mirror is reserved before the fetch starts.connect({ signal })).util/abort.tshelper (untilAborted) shared by both paths.doc/lib/js/net.md.Impact
FetchGroupOptions.signalin@moq/net.CANCELLED.Alternatives
fetch()does for a body. Not done: the quest scopes it to a pending fetch, andconnect({ signal })already ignores an abort after it resolves.Follow-ups
(Written by Claude Opus 5.5)
🤖 Generated with Claude Code