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 4 commits into
devfrom
quest/m1/close-codes
Open

kixelated wants to merge 4 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 current pins for every moqt:// and ws:// connection.
  • Pins web-transport-moq 1.3.2, qmux 0.6, web-transport-trait 0.5, web-transport-iroh 0.8, and web-transport-wasm 0.7. The set_priority impls take i32. moq-net keeps its u8 send orders and widens them at the trait boundary.

Verified with a local [patch.crates-io] on the four upstream branches merged pairwise (not committed): cargo check --workspace --all-targets passes; close_code passes; moq-net, moq-tokio, moq-uring, and moq-e2ee tests pass; clippy is clean.

Draft until the upstream crates are released (web-transport-moq is already pinned to the planned 1.3.2). Then refresh Cargo.lock and CI can build.

@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-27T00:48:49.878794Z d43956d Draft marked ready
ℹ️ 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 👍 / 👎.

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