Skip to content

fix(net): refuse partial lite groups and close the session on group violations - #6395

Merged
kixelated merged 3 commits into
mainfrom
quest/m1/release-audit/js-partial-group
Oct 24, 2026
Merged

kixelated merged 3 commits into
mainfrom
quest/m1/release-audit/js-partial-group

Conversation

@kixelated

@kixelated kixelated commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Subscriber.runGroup (js/net/src/lite/subscriber.ts) had two problems:

  • It read every group stream from frame 0. A lite-06+ group declaring frameStart: 5 therefore 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.
  • It caught every error, closed the group, and reset only that stream. A ProtocolViolation, including the existing one for a group past SUBSCRIBE_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.

  • A nonzero frameStart is a ProtocolViolation, raised before the group reaches the track. The compressed-group check (StreamError TooFarBehind) folds into this rule.
  • runGroup closes the group and rethrows a ProtocolViolation. The connection's existing uni-stream handler then closes the session with PROTOCOL_VIOLATION. Every other error stays stream-scoped as before.
  • subscribe-ranges/js.md pointed at this quest for the refusal, so its text now points at the code.

Impact

  • Public API: none.
  • Wire: none. A peer that sends a partial group, or a group past its declared end, now loses the session instead of one stream. The past-end violation already closed the track.

Validation

  • New in lite/connection.test.ts: a real Connection subscribes, and a hand-played publisher sends either a group with frameStart: 5 or a group past SUBSCRIBE_END. Both now close the session with PROTOCOL_VIOLATION; on main both time out with the session open.
  • tail.test.ts: the past-end case now expects runGroup to 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/hang libav 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)

kixelated and others added 2 commits October 22, 2026 14:27
…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
@kixelated kixelated changed the title JS refuses an unrequested partial lite group fix(net): refuse partial lite groups and close the session on group violations Oct 22, 2026
@kixelated
kixelated marked this pull request as ready for review October 22, 2026 21:38
@kixelated

Copy link
Copy Markdown
Collaborator Author

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. just check passes apart from the pre-existing @moq/hang libav failure fixed in #6382.

(Written by Claude Opus 5.5)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T23:04:19.798579Z 6cd0de4 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 355dbede-dc40-415f-bc03-5b6be9ebe441
📥 Commits

Reviewing files that changed from the base of the PR and between fe9bf01 and 6cd0de4.

📒 Files selected for processing: 6
  • js/net/src/lite/connection.test.ts
  • js/net/src/lite/subscriber.ts
  • js/net/src/lite/tail.test.ts
  • quest/m1/release-audit/README.md
  • quest/m1/release-audit/js-partial-group.md
  • quest/m1/subscribe-ranges/js.md
💤 Files with no reviewable changes: 2
  • quest/m1/release-audit/README.md
  • quest/m1/release-audit/js-partial-group.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

Walkthrough

The lite subscriber now rejects incoming groups with nonzero frameStart as protocol violations. Tests check that partial groups and groups beyond the declared subscription end close the client session. The tests retain the DRAFT_05 boundary behavior. Quest documentation now describes the current frameStart handling and removes the related release-audit entry.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 6cd0d

The change appears ready to merge after normal checks; no actionable issue remains from this review.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: refusing partial lite groups and closing the session for group violations.
Description check Passed The description directly explains the partial-group and session-closure changes, implementation approach, impact, and validation results.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kixelated
kixelated added this pull request to the merge queue Oct 22, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 23, 2026
@kixelated

Copy link
Copy Markdown
Collaborator Author

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 quest check passes against main.

(Written by Claude Opus 5.5)

@kixelated
kixelated enabled auto-merge October 23, 2026 21:07
…t/js-partial-group

# Conflicts:
#	quest/m1/release-audit/README.md
#	quest/m1/subscribe-ranges/js.md
@kixelated
kixelated added this pull request to the merge queue Oct 23, 2026
@kixelated

Copy link
Copy Markdown
Collaborator Author

Merged main into the branch (6cd0de4). Conflicts were quest-only:

  • quest/m1/release-audit/README.md: took main's child list and wording, minus the finished js-partial-group entry this PR deletes.
  • quest/m1/subscribe-ranges/js.md: kept main's per-reader group-bound sentence, pointed the frameStart note at lite/subscriber.ts runGroup, and dropped the Related section since both linked quests are now finished (moq-dev/moq#6419 and this PR).

just check and quest check --base origin/main pass locally; Codex thumbs-up on the new head. No code changes beyond the merge.

(Written by Claude Opus 5.5)

Merged via the queue into main with commit 6363aae Oct 24, 2026
10 checks passed
@kixelated
kixelated deleted the quest/m1/release-audit/js-partial-group branch October 24, 2026 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant