Skip to content

fix(net): send registered PUBLISH_DONE statuses - #3232

Merged
kixelated merged 1 commit into
mainfrom
codex/publish-done-status-3207
Aug 31, 2026
Merged

fix(net): send registered PUBLISH_DONE statuses#3232
kixelated merged 1 commit into
mainfrom
codex/publish-done-status-3207

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Closes #3207.

Root cause

The Rust IETF publisher treated PUBLISH_DONE like an HTTP response and emitted unregistered 200/500 status codes. The TypeScript publisher had kept a draft-14-through-16 guard after PUBLISH_DONE moved onto the request stream, so it emitted no terminal message for drafts 17 through 19. A rejected TypeScript track also reset the request instead of reporting a PUBLISH_DONE failure.

Change

  • Define typed internal Rust statuses for the two outcomes this implementation emits.
  • Send registered TRACK_ENDED (0x2) and INTERNAL_ERROR (0x0) codes.
  • Send PUBLISH_DONE from TypeScript for every supported draft, including failure completion.
  • Preserve legacy request IDs only for drafts 14 through 16.
  • Keep received status codes as raw integers so unknown extensions survive decoding.
  • Leave inbound unsupported PUBLISH handling unchanged.

This follows draft-19 sections 10.11 and 15.11.3. No repository draft changes are needed because this corrects our implementation of the external IETF draft without changing a moq-dev wire format.

Checks

  • nix develop --command just fix origin/main
  • nix develop --command just check origin/main
  • nix develop --command just test default origin/main (all JavaScript suites and 2,933 Rust tests passed)
  • nix develop --command just test smoke-full (all 21 Rust/Python/JS to Rust/Python/JS/native/C/GStreamer paths passed)
  • Focused Rust PUBLISH_DONE tests across drafts 14 through 19
  • Focused TypeScript codec and publisher tests: 104 passed

(Written by GPT-5.6)

Co-Authored-By: GPT-5.6 <noreply@openai.com>
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 13 minutes.

View limit details

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

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 05ab8ea9-6635-47dd-bc04-37f80a0434c4

📥 Commits

Reviewing files that changed from the base of the PR and between a2e4421 and 6afda0f.

📒 Files selected for processing (5)
  • js/net/src/ietf/ietf.test.ts
  • js/net/src/ietf/publisher.test.ts
  • js/net/src/ietf/publisher.ts
  • rs/moq-net/src/ietf/publish.rs
  • rs/moq-net/src/ietf/publisher.rs

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 Aug 31, 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-08-31T17:03:11.059835Z 6afda0f 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6afda0f37c

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// PUBLISH_DONE is required for every supported draft. The peer may have already
// closed its side to unsubscribe, in which case there is nowhere to send it.
try {
await stream.writer.u53(PublishDone.id);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Teach subscribers to consume PUBLISH_DONE

When a TypeScript publisher ends a draft-17 through draft-19 track, this new write leaves a PUBLISH_DONE message unread by both existing subscriber implementations. The TypeScript subscriber only waits on stream.reader.closed in js/net/src/ietf/subscriber.ts:502-505; a ReadableStream with queued message bytes does not become closed until those bytes are consumed, so the remote track remains open indefinitely. The Rust subscriber similarly calls Reader::closed() at rs/moq-net/src/ietf/subscriber.rs:1361, which deliberately returns an error when it finds additional bytes, causing normal completion to abort the track. Decode PUBLISH_DONE on the request stream before treating it as closed, including handling its status code.

Useful? React with 👍 / 👎.

@kixelated
kixelated merged commit f8f4a72 into main Aug 31, 2026
3 checks passed
@kixelated
kixelated deleted the codex/publish-done-status-3207 branch August 31, 2026 20:37
This was referenced Aug 31, 2026
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.

Send valid PUBLISH_DONE statuses for every supported IETF draft

1 participant