Skip to content

feat!: keep the peer's close code over qmux and raw QUIC, on web-transport-trait 0.5 - #4262

Open
kixelated wants to merge 5 commits into
devfrom
quest/m1/close-codes
Open

kixelated wants to merge 5 commits into
devfrom
quest/m1/close-codes

Conversation

@kixelated

@kixelated kixelated commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

A client loses the application close code its server sent (Session::abort(App(4011)), Request::reject(Reject::App(4011))) over WebSocket/qmux (ws://) and raw QUIC (moqt://). Instead it sees Transport("connection closed"), the close as text inside Transport(..), or its own Session(Internal). WebTransport is fine. Both bugs are upstream.

Approach

Fixed at the source:

Releasing qmux from web-transport main also ships #390's set_priority(i32), so the trait goes to 0.5 (moq-dev/web-transport#401, moq-dev/noq#13). This PR follows it:

  • rs/moq-tokio/tests/close_code.rs runs the issue's three cases (abort after accept, abort then drop, reject during handshake), 5 fresh connections each over https://, moqt://, and ws://. It fails on the previous pins for every moqt:// and ws:// connection.
  • Pins the released crates: web-transport-trait 0.5, qmux 0.6, web-transport-iroh 0.8, web-transport-wasm 0.7, and the noq fork's trait-0.5 major (moq-noq-proto, moq-noq-udp, web-transport-moq 2.0). Cargo.lock carries a single trait version.
  • The set_priority impls take i32. moq-net keeps its u8 send orders and widens them at the trait boundary.

@moq/qmux already keeps the first close, so no JS change.

Impact

  • Breaking (Rust): moq_net::web_transport_trait (re-exported) is now 0.5. SendStream::set_priority takes i32. moq_tokio::transport::Session<S> requires a trait-0.5 session. Hence dev.
  • Wire: none.

Alternatives

  • A qmux 0.5.2 cherry-picked from the tag would have kept this on main. The maintainer chose to release main with the trait bump.
  • Widening moq-net's own send order to i32 is left for later. Nothing needs it yet.

Follow-ups

  • Raw QUIC sessions in web-transport-moq still map stream RESET/STOP codes through the HTTP/3 space.

Closes #4249

(Written by Opus 5.5)

🤖 Generated with Claude Code

kixelated and others added 3 commits September 26, 2026 11:46
Runs the #4249 cases (abort after accept, abort then drop, reject during
the handshake) over https://, moqt://, and ws://. Fails until the qmux and
web-transport-moq fixes are released and pinned.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SendStream::set_priority takes an i32 send order in trait 0.5. moq-net
keeps its u8 send orders and widens them at the trait boundary. Pins
qmux 0.6, web-transport-iroh 0.8, and web-transport-wasm 0.7, which
implement the new trait.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title fix: keep the peer's close code over qmux and raw QUIC feat!: keep the peer's close code over qmux and raw QUIC, on web-transport-trait 0.5 Sep 26, 2026
@kixelated
kixelated changed the base branch from main to dev September 26, 2026 18:56
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

Decisions

  • The noq fork ships one 1.3.2 bundling noq#11, noq#12, and noq#13.
  • web-transport-moq stops re-exporting generic.

(Written by Opus 5.5)

@kixelated
kixelated marked this pull request as ready for review September 27, 2026 00:45
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 27, 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-09-28T02:41:59.780204Z b998832 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.

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

ℹ️ 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 Cargo.toml
pollster = "1.0"
pulldown-cmark = { version = "0.13", default-features = false }
qmux = { version = "0.5.1", default-features = false }
qmux = { version = "0.6", default-features = false }

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 Commit the updated dependency lockfile

The manifest now requires qmux 0.6 and the new WebTransport versions, but the unchanged Cargo.lock still pins qmux 0.5.1, web-transport-trait 0.4.0, and the previous adapter versions. The required quest validation invokes cargo run --locked, and cargo check --help defines --locked as asserting that Cargo.lock remains unchanged, so just check and CI cannot resolve this workspace after these manifest changes. Update and commit Cargo.lock with the released dependencies.

AGENTS.md reference: quest/AGENTS.md:L67-L72

Useful? React with 👍 / 👎.

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

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

let Ok(session) = request.ok().await else { return };
session.abort(moq_net::Error::App(CODE));
if let Case::Abort = case {
tokio::time::sleep(Duration::from_secs(5)).await;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Hold the abort session with synchronization

Case::Abort is supposed to cover aborting while the session handle remains alive, but this wall-clock delay makes that property depend on the client observing the close within five seconds. Under a stalled or heavily loaded CI worker, the timer can expire first, dropping the handle and collapsing this case into AbortThenDrop, so a retained-handle regression can go untested. Hold the session until the client observes closure, or use an explicit latch or pending task instead of sleeping; the Rust testing rules also require time-dependent async tests to pause Tokio time.

AGENTS.md reference: rs/AGENTS.md:L51-L54

Useful? React with 👍 / 👎.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Assessment

The goal is right and fixing close codes upstream (qmux first-close-wins, raw-QUIC ApplicationClosed decoding) is the correct approach rather than papering over losses in moq-net. The trait-0.5 bump, set_priority(i32) widens at the boundary, and the three-case / three-transport close_code regression are well scoped for dev.

But CI currently fails the PR's own regression: moq-tokio::close_code abort, abort_then_drop, and reject all lose the app code on ws:// with exactly MoqNet(Transport("connection closed")) — the #4249 symptom this PR claims to fix. https/moqt may be fine; the qmux path is not green on the pinned crates. Do not land a breaking trait bump whose end-to-end proof is red.

Recommendation: ITERATE — get ws:// close codes through to SessionError::App(4011) under the new pins (or confirm the qmux 0.6 release actually includes the first-close fix), then re-run the close_code suite green before merge.

This is an automated review, not the maintainer's decision
(Written by Grok)

This branch has not been deployed

No deployments
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.

Application close code is often lost over the WebSocket (qmux) transport: the client sees Transport("connection closed")

1 participant