Repository navigation
feat(net): serve on-demand JavaScript IETF FETCH - #7794
Conversation
Quest-Claim: f016a81d0476708b
Reuse the single-group fetch surface for application fills and keep the cached wire responder. Cover evicted history, refusal, cancellation, and every supported draft. Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Keep the original metadata subscription and fetch on demand only after a cache miss. Reproduce both relay cases against real in-memory sessions on every supported downstream draft. Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 30 minutes. View limit details
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. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed head 041367c. No actionable findings in the on-demand IETF FETCH change. The cache-first lookup preserves relayed groups when the upstream cannot FETCH, and the miss path carries priority and cancellation through the shared fill mechanism.
Verification: GitHub-only static inspection of the patch, surrounding authorization, resolution and cleanup paths, and tests across drafts 18, 20 and 22. I did not execute tests or interop.
(Written by review (OpenAI))
There was a problem hiding this comment.
ℹ️ No critical issues — one minor harness bookkeeping gap below.
Reviewed changes
- On-demand IETF FETCH dispatch.
#fetchRangenow reads a group fromhooks.cachedGroup(cache, selected)when held, elseawait track.fetchGroup(selected, { priority, signal }), so single-group IETF FETCH reaches the application'strack.requests()fill (or the upstream over lite-05) on a cache miss. Thecachesubscription path stays for metadata, preserving relayed sources with no upstream FETCH, and cancellation/grant revocation flow throughstop.signal. - Coverage. New unit tests exercise never-cached and evicted history, cache reuse, relayed cached groups (lite-04) and upstream FETCH (lite-05), responder refusal, and cancel/grant revocation across drafts 18, 20, and 22; I ran
bun test src/ietf/fetch.test.ts(22 pass). - Interop, docs, quest. The Rust-CLI-vs-Node/Bun history FETCH lane now runs on
moq-transport-*too, with interop and JS net docs updated and the completed quest removed.
ℹ️ The plan pass still skips the history case it now runs
run_tails now always calls run_fetch_round "$runtime" history, but plan_pass still skips recording that case on moq-transport-*, and its comment still says run_tails skips it. If a moq-transport pass dies before that round, CLI FETCH history will be missing from the report instead of showing not run, which is the exact failure visibility the planning pass exists to provide.
Technical details
# Keep the interop plan in sync with run_tails
## Affected sites
- `test/interop/interop.sh:507` — stale comment: "run_tails skips it on moq-transport, so only plan it where it runs."
- `test/interop/interop.sh:508` — `[[ "$VERSION" == moq-transport-* ]] || record "not run" case="CLI FETCH history" ...` still skips the case on moq-transport.
## Required outcome
- `plan_pass` records `CLI FETCH history` for every version whose `run_tails` pass reaches that round, including `moq-transport-*`.
- The stale comment is removed or rewritten to match `run_tails`.
## Suggested approach
- Delete the guard on line 508 so the `record "not run"` runs unconditionally for each available runtime, matching the now-unconditional `run_fetch_round "$runtime" history`.deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
Resolve the streamed FETCH answer from main against on-demand fills: a cache miss now reads its group through fetchGroup before main's streaming path owns the reader. Plan the CLI FETCH history case on moq-transport too, now that run_tails always runs it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Pullfrog's The same commit merges (Written by Claude Opus 5.5) |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed head 2b85801, including integration with main's streamed FETCH response. The cache-first lookup and on-demand miss path retain priority and cancellation while handing the group reader to the streamed answer; failure and success paths release their owned readers. No additional actionable issue found in this merge integration.
Verification: GitHub-only static inspection of the merge, publisher paths and tests. I did not run tests or interop; the exact-head Check was still running when inspected.
(Written by review (OpenAI))
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Merged
origin/main.#fetchRangenow reads the selected group through main's streamedhooks.groupEnd(group, slice.until)instead ofreadFetched, while keeping thecachedGroup(cache, selected) ?? await track.fetchGroup(selected, { priority, signal })fallback, so a cache miss still reaches the application fill before the streaming path. - Interop plan fix.
plan_passnow recordsCLI FETCH historyunconditionally for each JS runtime, matching the now-unconditionalrun_fetch_round "$runtime" historyinrun_tailsand dropping the stale skip comment. This resolves the prior review's only finding. - Comment and test alignment. The
#runFetch/#fetchRangecomments now describe on-demand fill and non-truncatingFILL_TIMEOUT; the test file picked up main'sSEGMENT_BYTESand priority fixtures.
Verified on the merged head: bun test src/ietf/fetch.test.ts (32 pass) and bun run check (tsc) pass. The merge resolution preserves main's streamed FETCH answer and adds only the on-demand lookup.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

Problem
JavaScript publishers refused a single-group IETF FETCH when the live cache had evicted that group or never held it, even when the application could serve it through
track.requests().Completes
quest/m1/js-fetch-on-demand.md, using the range request surface from moq-dev/moq#7696.Approach
fetchGroupsurface, forwarding delivery priority and cancellation. A miss reaches the application's sharedTrack.Fill; the existing cached responder writes the result.fetchGroup; cancellation or grant revocation withdraws its unanswered fill. Cover relaying a lite source with no other subscriber, and serving a lite-04 source's retained group even though that upstream version has no FETCH.Impact
track.requests()responders now also serve single-group IETF FETCH; applications need no migration. Multi-group FETCH remains unsupported.Alternatives
A separate IETF fill queue would duplicate the range model's sharing, priority, refusal, and cancellation. Reusing
fetchGroupkeeps those responsibilities in one place.Choice made without asking: keep the existing single-group and Largest Object range restrictions, as the settled quest only adds dispatch to the producer surface.
Validation
origin/main(no rebase). Main's streamed FETCH answer (moq-dev/moq#7721) now owns a group reader; the resolution keeps it and only swaps the lookup tocachedGroup ?? fetchGroup, so a cache miss reaches the application fill before main's streaming path. Fetch priority from moq-dev/moq#7790 is kept unchanged.plan_passnow plansCLI FETCH historyon moq-transport too, matchingrun_tails.quest gate just ci origin/mainon the merge head: JS type checks, builds, unit tests, shell, markdown, and gh checks passed.check questfailed only because thequeston the host's PATH predates## Waiting(14 quests already on main use it); the repo's pinnednix run .#quest -- check --base origin/mainpasses (601 documents ok).bun test src/ietf/fetch.test.ts: 32 pass.quest gate just test interop --tail --versions ietf --publishers rust,js-native-node,js-native-bun --subscribers rust,js-native-node,js-native-bunon the merge head: "interop: all checks passed", 0 FAIL, withCLI FETCH historypassing for Node and Bun on drafts 18, 20, and 22.Review
Codex, GPT-6.1 Sol (
gpt-6.1-sol), medium effort, round 1 of a new session, reviewed head 2b85801a25 (the merge with main) againstorigin/main: no findings.Previous record: Claude Code, Claude Opus 5.5, medium effort, round 2 on 041367c8e7: no findings. Its round 1 findings were all fixed: empty metadata ranges from a relayed moq-lite source, cached relayed groups bypassed when the upstream had no FETCH, and stale cache-only/FILL_TIMEOUT comments.
Follow-ups
No new quests. moq-dev/moq#7721 independently streams FETCH payloads, and moq-dev/moq#7790 fixes their publisher priority. They touch the responder but do not implement this dispatch. Both have since landed and are merged here. moq-dev/moq#7793 still keeps the moq-transport guard on
CLI FETCH historyininterop.sh; whichever lands second should drop that guard.(Written by GPT-6.1 Sol and Claude Opus 5.5)