Skip to content

Upgrade web-transport crates to v0.10.1 - #143

Merged
englishm merged 5 commits into
cloudflare:mainfrom
englishm-cloudflare:me/web-transport-upgrade
Feb 18, 2026
Merged

Upgrade web-transport crates to v0.10.1#143
englishm merged 5 commits into
cloudflare:mainfrom
englishm-cloudflare:me/web-transport-upgrade

Conversation

@englishm-cloudflare

@englishm-cloudflare englishm-cloudflare commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Upgrade the web-transport dependency family from v0.3.x to v0.10.1 / v0.11.4 from crates.io.

  • web-transport v0.3.0 → v0.10.1
  • web-transport-quinn v0.3.4 → v0.11.4
  • web-transport-proto v0.2.8 → v0.5.2

What's new in web-transport-quinn v0.11.x

  • H3 SETTINGS exchange: ENABLE_DATAGRAM, WEBTRANSPORT_MAX_SESSIONS, ENABLE_CONNECT_PROTOCOL, and Chrome-compat deprecated settings
  • Capsule protocol for graceful session close
  • Sub-protocol negotiation via wt-available-protocols headers
  • GREASE filtering in H3 settings
  • Session::raw() for clean raw-QUIC (moqt:// scheme) fallback
  • Session stores ConnectRequest with URL (enables future path extraction)
  • web_transport_trait::Session trait for backend abstraction

API changes adapted

  • ALPN constant: &[u8]&str (.as_bytes() added at call sites)
  • Accept: accept(conn)Request::accept(conn) then .ok().await
  • Connect: connect_with(conn, url)Session::connect(conn, url)
  • Raw QUIC: conn.into()Session::raw(conn, url, ConnectResponse::default())
  • Error types: three variants (Session, Read, Write) collapsed into one web_transport::Error
  • is_graceful_close() updated for the new error type hierarchy
  • Session methods: &mut self&self
  • Reader: read_buf() returns Option<usize> instead of bool; read_chunk() renamed to read()

Testing

  • cargo test --verbose — all 88 tests pass
  • cargo clippy --no-deps — clean
  • cargo fmt --check — clean
Upgrade from web-transport v0.3.0 / web-transport-quinn v0.3.4 /
web-transport-proto v0.2.8 to web-transport v0.10.1 /
web-transport-quinn v0.11.4 / web-transport-proto v0.5.2.

The v0.11.x quinn backend has proper support for:

- H3 SETTINGS: ENABLE_DATAGRAM, WEBTRANSPORT_MAX_SESSIONS,
  ENABLE_CONNECT_PROTOCOL, and Chrome-compat deprecated settings
- Capsule protocol for graceful session close
- Sub-protocol negotiation via wt-available-protocols headers
- GREASE filtering in H3 settings
- Session::raw() for clean raw-QUIC (moqt:// scheme) fallback
- Session stores ConnectRequest with URL (enables future path extraction)
- web_transport_trait::Session trait for backend abstraction

API changes adapted:
- ALPN constant changed from &[u8] to &str (.as_bytes() added)
- accept(conn) -> Request::accept(conn) then .ok().await
- connect_with(conn, url) -> Session::connect(conn, url)
- conn.into() -> Session::raw(conn, url, ConnectResponse::default())
- Three error variants collapsed into one web_transport::Error
- is_graceful_close() updated for new error type hierarchy
- Session methods now take &self instead of &mut self
- read_buf() returns Option<usize> instead of bool
- read_chunk() renamed to read()
@englishm-cloudflare englishm-cloudflare changed the title Upgrade web-transport crates (git main branch) Feb 18, 2026
web-transport-quinn v0.11+ decodes HTTP/3-encoded close codes at the
SessionError level. A WebTransport graceful close (code 0) now arrives as
WebTransportError::Closed(0, "") rather than
ConnectionError::ApplicationClosed(h3_encoded_code).

Without this fix, is_session_error_graceful() returned false for all
WebTransportError variants, misclassifying graceful WebTransport closes
as errors in metrics.
WebTransport graceful close is driven by CLOSE_WEBTRANSPORT_SESSION
capsule (code 0), not APPLICATION_CLOSE directly. Updated doc comments
to distinguish the two transport mechanisms accurately.
web-transport-quinn, web-transport-proto, and quinn are all accessible
via re-exports from the web-transport crate (web_transport::quinn::*,
web_transport::quinn::proto::*, web_transport::quinn::quinn::*).

Removes the direct dependencies, fixing the cargo-machete lint.
The SessionError conversion from ConnectionError via error_from_http3
is the typical path but not guaranteed for all cases. Wording now
reflects that decoding depends on the conversion path being used and
succeeding.
@englishm
englishm merged commit 3c7492d into cloudflare:main Feb 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants