Repository navigation
fix(net): refuse partial lite groups and close the session on group violations - #6395
Conversation
Quest-Claim: 9387dc9fbd09ec8f
…iolations The JS lite subscriber read a group stream declaring `frameStart` above 0 as if it started at frame 0, misnumbering every frame resumption and deduplication rely on. It never asks for a mid-group start, so such a group is a peer bug: refuse it as a ProtocolViolation, folding in the compressed-group check. `runGroup` caught every error and reset only that stream, so this violation, and the existing one for a group past the declared end, never reached the connection. A violation now escapes `runGroup` and the connection closes the session on it; ordinary group errors stay stream-scoped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EeyiEy5FWz3z44DYZVo7vU
|
Outcome: the quest is complete and its file is deleted. Both group-stream violations now close the session. There are no open decisions, so this is ready for review. (Written by Claude Opus 5.5) |
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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughThe lite subscriber now rejects incoming groups with nonzero Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
|
Merging. Iterated to settle the maintainer's decisions, then chosen for /quest-merge. CI is green, the current head has a non-Grok review, and (Written by Claude Opus 5.5) |
…t/js-partial-group # Conflicts: # quest/m1/release-audit/README.md # quest/m1/subscribe-ranges/js.md
|
Merged main into the branch (6cd0de4). Conflicts were quest-only:
(Written by Claude Opus 5.5) |
Problem
Subscriber.runGroup(js/net/src/lite/subscriber.ts) had two problems:frameStart: 5therefore exposed its first frame as frame 0, so a partial group looked complete, corrupting the frame positions that resumption and deduplication rely on. The offset was only checked for compressed groups.ProtocolViolation, including the existing one for a group pastSUBSCRIBE_END, never reached the connection's dispatch, so a hostile peer could repeat it on every stream.Completes Refuse partial lite groups.
Approach
Decided 2026-10-22 in the quest: refuse the offset rather than model it.
frameStartis aProtocolViolation, raised before the group reaches the track. The compressed-group check (StreamErrorTooFarBehind) folds into this rule.runGroupcloses the group and rethrows aProtocolViolation. The connection's existing uni-stream handler then closes the session withPROTOCOL_VIOLATION. Every other error stays stream-scoped as before.subscribe-ranges/js.mdpointed at this quest for the refusal, so its text now points at the code.Impact
Validation
lite/connection.test.ts: a realConnectionsubscribes, and a hand-played publisher sends either a group withframeStart: 5or a group pastSUBSCRIBE_END. Both now close the session withPROTOCOL_VIOLATION; onmainboth time out with the session open.tail.test.ts: the past-end case now expectsrunGroupto reject with the violation, and the track still aborts with it.bun test src/lite: passes.just check: passes apart from the pre-existing@moq/hanglibav test-order failure, fixed in moq-dev/moq#6382.🤖 Generated with Claude Code
https://claude.ai/code/session_01EeyiEy5FWz3z44DYZVo7vU
(Written by Claude Opus 5.5)