Skip to content

fix(net): withdraw PUBLISH_NAMESPACE by reset on draft-17+ (release backport) - #6518

Merged
kixelated merged 3 commits into
releasefrom
backport/js-namespace-reset
Oct 23, 2026
Merged

kixelated merged 3 commits into
releasefrom
backport/js-namespace-reset

Conversation

@kixelated

@kixelated kixelated commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Backports the js/net half of moq-dev/moq#5483 to release, so it ships in the next @moq/net patch release. The 0.4.5 bump (moq-dev/moq#6501) already shipped without it.

Problem

On drafts 17+ the published @moq/net 0.4.4 withdraws a PUBLISH_NAMESPACE with FIN plus STOP_SENDING. Draft-18 §3.3.2 cancels a request by terminating every open direction abruptly, and a FIN is allowed only on SUBSCRIBE_NAMESPACE and SUBSCRIBE_TRACKS. Cloudflare's draft-18 relay and aiomoqt (draft-22) act only on the reset, so their subscribers never see NAMESPACE_DONE until the publisher's session ends.

That is why the interop runner's moq-dev-js subscribe-namespace-lifecycle case fails against them (englishm/moq-interop-runner#173). It passed from two processes only because the publisher process exiting closes the session.

Reproduced with the runner's client against each signal on its own:

Withdrawal Cloudflare d18 aiomoqt d22
FIN + STOP_SENDING (0.4.4) fail fail
FIN only fail fail
STOP_SENDING only fail fail
FIN, ack, then STOP_SENDING fail fail
RESET_STREAM only pass pass
RESET_STREAM + STOP_SENDING (this PR, main) pass pass

Our sender was out of spec, so nothing goes upstream.

Changes

  • #withdraw on drafts 17+ now aborts both directions with CANCELLED and returns, as on main. Drafts 14-16 keep PUBLISH_NAMESPACE_DONE then FIN, unchanged from release (it never waited for the FIN ack there).
  • The subscriber side treats a peer's CANCELLED reset of a PUBLISH_NAMESPACE as the end of the request on drafts 17+, retracting and returning; any other reset code still fails the request. Without it, a release subscriber reading this withdrawal from another @moq/net failed the bidi stream: it logged error processing bidi stream and answered with INTERNAL_ERROR on every routine unpublish. main already ends a request this way through RequestStream.
  • Tests: as in fix(net): withdraw PUBLISH_NAMESPACE by reset on draft-17+ #5483. The republish and refused-update tests expect a Cancel reset. The two "a replacement waits until its predecessor's FIN is acknowledged/rejected" tests are removed, since that ordering no longer exists. The republish integration cycle also runs on drafts 17 and 19.
  • The Rust half of fix(net): withdraw PUBLISH_NAMESPACE by reset on draft-17+ #5483 is not ported. The published moq-tokio 0.19.28 runner client passes the same cells against both relays over WebTransport and raw QUIC, so release Rust is unaffected in practice.

Public API and wire impact

  • Public API: none.
  • Wire: on drafts 17+ a JS PUBLISH_NAMESPACE withdrawal is RESET_STREAM + STOP_SENDING (CANCELLED) instead of FIN + STOP_SENDING. Drafts 14-16 and moq-lite are unchanged. Matches main since fix(net): withdraw PUBLISH_NAMESPACE by reset on draft-17+ #5483.
  • Behavior: on 17+ a republish no longer waits for the old request's FIN ack before the new PUBLISH_NAMESPACE, as on main.

Tests

  • The three changed publisher.test.ts cases fail without the fix and pass with it.
  • Two new subscriber.test.ts cases: a CANCELLED reset withdraws without an error (fails without the subscriber change), and an INTERNAL_ERROR reset still fails the request.
  • just check origin/release passes.
  • just test interop --all: every cell passes except the browser js publisher and subscriber, which fail to launch Chromium (release's lockfile pins a Playwright that does not match the dev shell's browsers). js-native-node and js-native-bun pass. The harness runs moq-lite, which this change does not touch, so the live relay runs below are the real coverage.
  • The runner's subscribe-namespace-lifecycle against this branch: passes on Cloudflare d18, aiomoqt d22, imquic d22, moxygen d16, cdn.moq.dev, and stitcher-moq. Cloudflare's draft-14 endpoint times out waiting for the first NAMESPACE on 0.4.4 too, so it is unrelated.

Decisions

  • ✅ Ship this JS-only on release in the next @moq/net patch; no Rust backport (maintainer).
  • ✅ Fix the Codex findings here rather than leave them: the reset this PR sends would otherwise be logged as an error by every release subscriber. Only CANCELLED is quiet, so a genuine peer failure still surfaces (narrower than main's RequestStream, which ends on any reset).

Tracked by the quest PR moq-dev/moq#6503.

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

…ackport)

Backports the js/net half of #5483. On drafts 17 and later a withdrawal
was a plain FIN, which drafts 17+ allow only on SUBSCRIBE_NAMESPACE and
SUBSCRIBE_TRACKS. Cloudflare's draft-18 relay and aiomoqt ignore it, so
their subscribers never see NAMESPACE_DONE until the publisher's session
ends. Withdraw by cancelling both directions instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review October 23, 2026 06:58
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 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-23T16:27:31.641143Z d1ff3b7 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.

kixelated added a commit that referenced this pull request Oct 23, 2026
The cause is @moq/net 0.4.4 withdrawing PUBLISH_NAMESPACE with a FIN on
drafts 17+, fixed on main by #5483 and backported to release by #6518.
What remains is bumping the runner's JS client once that patch publishes.

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

@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: f6b2d39681

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

Comment thread js/net/src/ietf/publisher.ts Resolved
@kixelated kixelated mentioned this pull request Oct 23, 2026
The withdrawal is now a CANCELLED reset, so a release subscriber reading
it failed the bidi stream: it logged an error and answered with
INTERNAL_ERROR on every routine unpublish. Treat the reset as the end of
the request, as main's RequestStream does.

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

@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: 5d7cf83b60

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

Comment thread js/net/src/ietf/subscriber.ts Resolved
Any other reset is the peer failing, so keep it on the error path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated enabled auto-merge (squash) October 23, 2026 16:41
@kixelated

Copy link
Copy Markdown
Collaborator Author

Merging after one iteration round.

  • Fixed both Codex findings on the subscriber side: on drafts 17+ a peer's CANCELLED reset of a PUBLISH_NAMESPACE now ends the request quietly (retract and return), so a release subscriber no longer logs an error and answers with INTERNAL_ERROR for every routine withdrawal this PR sends. Any other reset code still fails the request. Two subscriber tests cover both.
  • Decisions (maintainer): ship JS-only on release in the next @moq/net patch; no Rust backport. No version bump here; releases are cut separately.
  • just check origin/release and quest check pass; Codex approved the final head (d1ff3b7). Auto-merge is enabled on that SHA.

(Written by Claude Opus 5.5)

@kixelated
kixelated merged commit 350dee5 into release Oct 23, 2026
5 checks passed
@kixelated
kixelated deleted the backport/js-namespace-reset branch October 23, 2026 16:49
kixelated added a commit that referenced this pull request Oct 23, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gmarzot pushed a commit to englishm/moq-interop-runner that referenced this pull request Oct 26, 2026
@moq/net 0.4.4 withdraws a PUBLISH_NAMESPACE on drafts 17+ with a FIN,
which draft-22 §6.4.2.2 says is not a cancellation, so a relay that
follows it keeps the namespace and the subscriber never gets
NAMESPACE_DONE: subscribe-namespace-lifecycle timed out against moq-go,
moxygen, moq-rs-draft-18, quic-zig and quiche-moq in the nightly. 0.4.6
carries moq-dev/moq#6518 and withdraws with a reset.

Against the moq-go relay the client built from this commit passes all
eight tests, subscribe-namespace-lifecycle included (0.4.4: seven).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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