Repository navigation
fix(net): a lite-07 relative start settles its window before asking fills - #8197
Conversation
Quest-Claim: cc0b5826ed76c34d
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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 2 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. |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
track.tssettles before the start ask —hooks.sourceStartnow calls#settle()before reading the publisher's start, the cursor floor, and#filling(), mirroring Rust'spoll_start(cursor.sync()beforecursor.floor()/misses.lowest()). A pending relative anchor no longer leaves the window covering every group, so the fill ask can no longer drag the reported start to0.- Regression test forces the losing order — the
test.skipis gone, and a sibling reader consumes the frameless newest group afterreader.info()so the reader's window is still pending whenstart()is asked;sibling.close()joins the cleanup. - Quest bookkeeping — the epic README paragraph records the cause and
#8197, and the quest file is deleted with no dangling references.
I verified the regression independently in this run: 30/30 pass with the fix, and 20/20 fail at integration.test.ts:535 (Expected: 5n / Received: 0n) with the three added track.ts lines reverted. bun test src/track.test.ts src/resume.test.ts src/lite/tail.test.ts reports 410 pass, and tsc --noEmit in js/net is clean. The Rust mirror already syncs its cursor, so leaving it unchanged is correct.
The alternative noted in the PR body (making #filling() read-only like Rust's misses.lowest()) is the larger change; settling first lands the same mirrored result and keeps this fix minimal, so no concern there.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed head 919b3c4 against base d389cfb.
No actionable findings. Settling the reader's window before asking fills prevents an unresolved relative anchor from requesting history outside its eventual range and lowering the reported start. The sibling-reader setup forces group 5 to arrive before the tested reader asks start(), rather than relying on scheduling luck. Existing start and subsequent-group assertions are preserved.
Direction: retain the settlement-before-fill ordering and the deterministic regression.
Verification limits: GitHub-only static review of the complete diff and Subscriber settlement, cursor bounds, fill requests and sourceStart paths. No Bun, CI or reproduction runs performed.
Rechecked state, full head/base and published reviews immediately before posting.

Problem
js/net's "integration: lite-07 reports a relative start over a frameless newest group" sometimes readreader.start()as0ninstead of the publisher's5n(quarantined withtest.skip). It reproduced about 1 in 60 runs with 8 parallel copies of the integration file. Debug logging showed the publisher sent5and the copy declared5. The0came from the reader:hooks.sourceStartcalled#filling(), which asks fills over the reader's window without settling it. When group 5 had already landed (received=6) but the reader had not read since, its relative anchor was still pending, so the window covered every group. That asked a fill for[0, 5), andmin(5, 0)returned 0.Approach
hooks.sourceStartsettles the window first, asfloor()andnextInRange()already do and as the Rustpoll_startdoes withcursor.sync(). The test now forces the losing order: a sibling reader on the same copy reads group 5 before the reader asksstart(), so the reader's window is unsettled when it asks. Without the fix the test fails 50/50; with it, it passes 200/200 under--rerun-each. Thetest.skipis removed and the quest is deleted.The Rust mirror (
a_relative_start_reports_the_publishers_start_over_a_frameless_newest_group) has no such ordering:poll_startsyncs the cursor before readingmisses.lowest()and asks no new misses, so it is unchanged.Impact
Caused by
sourceStartwithout settling the window firstAlternatives
#fillingonly read the fills already out, as Rust'smisses.lowest()does, instead of asking. That is a larger behavior change than this bug needs, and settling first already gives the mirrored result.Choices made without asking
Follow-ups
None.
Validation
bun test src/integration.test.ts -t "frameless newest" --rerun-each 200: 200 pass (fails 50/50 with thetrack.tschange reverted)quest gate just ci: passModels
Size: S
Implementer: Claude Code, claude-opus-5-5, medium effort
🤖 Generated with Claude Code
(Written by Claude Opus 5.5 with medium)
Review
Rewritten by
quest reviewafter each round.01a1b833-db74-75b0-a198-8b853829e9fc, round 1The fix settles the subscriber’s window before requesting fills and adds a regression test enforcing the failing order; source review found no actionable defects, but builds and tests were not run as instructed.Merged origin/main at ba44c18 (conflict only in
quest/m0/test-flakes-2/README.md's flake notes; kept main's new entries and this PR's fix paragraph, dropped the quarantine note). The PR's diff against main is otherwise identical to the reviewed head 919b3c4, so the review above stands.