Skip to content

fix(json): treat a publisher-reset group as a lost group - #6204

Merged
kixelated merged 1 commit into
mainfrom
fix/json-snapshot-wire-old
Oct 22, 2026
Merged

kixelated merged 1 commit into
mainfrom
fix/json-snapshot-wire-old

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Problem

When a publisher resets a superseded group, it sends stream code Old. The reader sees that as Error::Stream(StreamError::Old).

#5677 narrowed the lost-group match in these readers to the locally raised variants (Error::Old | Evicted | Lagged | GroupTooLarge):

  • moq-json snapshot consumer
  • moq-json window consumer
  • moq-flate snapshot consumer

So a wire reset now surfaces as a fatal error. A hang catalog is a long-lived snapshot group, which makes this hit catalog readers. For example, moq-hls's watch_catalog gives up on the broadcast and never resubscribes, so a recording of that broadcast stays empty.

It is intermittent: it needs the publisher to supersede the catalog group while a relay-side reader is attached. A relay recorder loop reproduced it about once in 75 broadcasts. Instrumented, the failing read was Stream(Old).

Fix

Classify the error by StreamError::from(&err), the same mapping the wire uses, so the local and wire spellings count as the same loss:

  • Old
  • Evicted
  • TooFarBehind
  • GroupTooLarge

The JS consumers already classify by StreamCode, so this brings Rust in line.

There is no public API or wire change.

Tests

The existing lost-group tests now run once per spelling: local Error::Old, then the wire Error::Stream(StreamError::Old). The window test also covers the wire TooFarBehind, Evicted and GroupTooLarge. All three tests fail without the fix.

just check passes except nix flake check. That step builds the github-runner image, which needs user namespaces this host's Nix sandbox refuses. The diff touches no Nix. I ran every stage after it by hand, plus just rs test-changed: 4364, 516 and 224 tests, all passing.

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

A publisher resets a superseded group with stream code Old, which a reader
sees as Error::Stream(StreamError::Old). #5677 narrowed the lost-group match
in the moq-json snapshot and window consumers, and the moq-flate snapshot
consumer, to the locally raised variants, so that reset became a fatal error
and a catalog reader stopped for good. Classify by StreamError instead, so the
local and wire spellings are the same loss.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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 49 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 58bf7196-0b28-480c-aefd-1342cf47e59d
📥 Commits

Reviewing files that changed from the base of the PR and between d20d2dd and 221cc5b.

📒 Files selected for processing: 6
  • rs/moq-flate/src/snapshot/consumer.rs
  • rs/moq-flate/src/snapshot/mod.rs
  • rs/moq-json/src/snapshot/consumer.rs
  • rs/moq-json/src/snapshot/mod.rs
  • rs/moq-json/src/window/consumer.rs
  • rs/moq-json/src/window/mod.rs
  • 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 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-21T19:59:02.531270Z 221cc5b PR opened
ℹ️ 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.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Merge summary: no changes made during /quest-merge.

  • Review: Codex reviewed head 221cc5bc2a64cb87516083b79206231cf6eb068a with no findings (+1). CodeRabbit was rate limited.
  • CI: all PR-level checks pass; Check runs in the merge queue.
  • Verified: StreamError::from(&Error) maps only Old, Evicted, Lagged and GroupTooLarge (plus their wire spellings) to the four matched codes, so local behavior is unchanged and wire resets now count as the same loss.
  • Other readers (moq-hls rendition, moq-ffi, moq-cli) already match both spellings.

Enabling auto-merge on the head above.

(Written by Claude Opus 5.5)

@kixelated
kixelated added this pull request to the merge queue Oct 21, 2026
kixelated added a commit that referenced this pull request Oct 21, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged via the queue into main with commit 14bc362 Oct 22, 2026
9 checks passed
@kixelated
kixelated deleted the fix/json-snapshot-wire-old branch October 22, 2026 02:02
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