Repository navigation
test(js/net): a recovery's CANCEL echo no longer fails the lost-run wire check - #9203
Conversation
…ire check A viewer's recovery stops a group no fill owes any more with CANCEL. When the stop beats the relay's FIN, the relay names that group in SUBSCRIBE_DROP with the stop's code, by design. The recovery takes it as a passing refusal that settles nothing, but the test counted it as a settling drop. The tap now marks subscriptions opened after the chain's two, and the check excludes only a recovery's CANCEL. Also fixes stale Rust mirror test names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Approach: sound. The test narrows its wire check to ignore only the subscriber's own CANCEL echo on a recovery subscription, and every other non-OLD drop still fails it.
Reviewed changes: the single test file js/net/src/lite/drop_record.test.ts.
recoverytagging intap(): subscriptions opened after the chain's first two are markedrecovery. The fallback for an unknown reader isrecovery: true, which matches thehops.size >= 2rule.- Lost-run wire check: it excludes only
CANCELdrops on a recovery. I confirmed the exclusion is limited to that one code and thatStreamCode.Cancelexists. - Comment fixes: the three renamed
Mirrors Rust ...references point to Rust tests that exist inrs/moq-net/tests/integration/drop_record.rs. The mirror for the lost-run pair is dropped because it has no Rust counterpart.
claude-sonnet-5-5 | 𝕏
|
No actionable comments were generated in the recent review. WalkthroughThe drop-record test helper now records whether decoded drops and skips came from recovery subscriptions. The lost-run test excludes OLD drops and recovery CANCEL drops from its final-drop check. Test names and Rust mirror comments describe the corresponding scenarios more specifically. Merge Risk:
|

Problem
js/net/src/lite/drop_record.test.ts, "a sequence whose run the relay forgot is filled for a wide reader", fails intermittently in the merge queue (run 44577207435, run 44571188329). It asserts that no non-OLD drop crosses the wire after the run is forgotten, and it sometimes sees{ hop: "down", start: 1n, end: 2n, error: 1 }(CANCEL).It is a test race, not a relay forwarding bug. During the narrow reader's phase, the viewer's recovery subscription for groups 1 and 2 is left owing nothing once the narrow reader judges them stale. It aborts the groups and stops their streams with CANCEL (
untilAbandonedinlite/subscriber.ts). If the relay already wrote the group's FIN, the stop is a no-op. If the stop arrives first, the relay's write fails, and its publisher names the group in SUBSCRIBE_DROP with the stop's code. Both TS and Rust do this on purpose (Rust'sa_stopped_group_stream_is_dropped_with_its_stop_code). The viewer's recovery reads that drop as apassingrefusal (lost: false), which answers only the fills owing the group at that moment and is recorded nowhere, so it settles no reader. In every failing run, the wide reader still received groups 1 and 2 with no drop.Approach
tap()marks each subscription opened after the chain's two (the relay's upstream and the viewer's) asrecovery.Mirrors Rust ...comments in the file. Three named Rust tests that no longer exist now name their current counterparts. The lost-run pair's mirror is removed, since it has no Rust counterpart.Validation
All loops ran the whole
drop_record.test.tsfile underquest gate, with one busy loop per core as load. On its own, the test passed 200/200 without load.stop sending: 1on group 1's stream before its FIN. Passing runs logged the FIN first.{"hop":"down","recovery":true,"kind":"drop","start":"1","end":"2","error":1}, and the wide reader's own checks (no drop, groups 1 and 2 filled) held each time.just checkpassed.Impact
Alternatives
Decisions
Made headless, as a child of the test-flakes epic. Each can be undone in review:
quest startclaims only quests already on main, and this session merges nothing. The quest (quest/m0/test-flakes-3/js-lost-run-cancel-echo.md, S, m0, because flakes join the open m0 epic) would be created and deleted here, so it has no file and its decisions are recorded here.Caused by
Follow-ups
None.
Models
Size: S
Implementer: Claude Code, claude-opus-5-5, unknown effort
(Written by Claude Opus 5.5)
🤖 Generated with Claude Code
Review
Rewritten by
quest reviewafter each round.Head: 73d8a22
Base: origin/main at 947d61c
Risk: medium,
the base has no RISK.md to name what is always high or customer-facing, so every change is mediumClassified: medium by default
Reviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a1f523-d75c-7b80-b68c-bd87628e89fe, round 1Score: 9/10,
Source review found no actionable defects in the recovery-subscription CANCEL handling test, but tests were not run as instructed.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none