feat: add Session::path() to the transport trait; restore qmux path parameter#271
feat: add Session::path() to the transport trait; restore qmux path parameter#271kixelated wants to merge 1 commit into
Conversation
…aram Add `fn path(&self) -> Option<&str>` to `web_transport_trait::Session` (companion to `protocol()`): the request path the peer connected to, for transports that carry one. Lets a generic consumer (moq-net) read the path uniformly instead of guessing by URL scheme. - web-transport-trait: new `path()` default method (returns None). - qmux: revert #266 to restore the in-band `path` transport parameter, `Config::path()` builders (tcp/uds/tls), and `Session::path()`; wire it through the trait impl. Keeps the 0.3.1 version/changelog. - web-transport-quinn/quiche/noq: return the CONNECT request's url path. - web-transport-iroh: return the HTTP/3 request path; None for raw iroh. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Sorry @kixelated, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
WalkthroughA new 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches✨ Simplify code
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@rs/qmux/src/error.rs`:
- Around line 54-55: The public qmux::Error enum is being extended with a new
InvalidPath variant, which changes the exhaustive match surface for downstream
users. Either avoid exposing this as a new public variant in Error, or update
the crate version/changelog to reflect the breaking API change before shipping.
Locate the change in the Error enum in error.rs and keep the public error
surface stable if this release is meant to remain non-breaking.
In `@rs/qmux/src/proto/params.rs`:
- Around line 31-39: `TransportParams` now exposes a new public `path` field,
which is a breaking API change for downstream construction and exhaustive
matching. Either update the qmux version/changelog to reflect the breaking
change, or adjust the API shape in `TransportParams` to remain
backward-compatible (for example by avoiding a new public field on the struct).
Use the `TransportParams` definition in `params.rs` as the place to make the
change and ensure the release notes/versioning match the public API change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9034193e-e4a0-492f-a3c6-bc9abf3a80bd
📒 Files selected for processing (15)
js/qmux/src/frame.test.tsjs/qmux/src/frame.tsrs/qmux/src/config.rsrs/qmux/src/error.rsrs/qmux/src/proto/params.rsrs/qmux/src/session.rsrs/qmux/src/tcp.rsrs/qmux/src/tls.rsrs/qmux/src/uds.rsrs/qmux/tests/negotiation.rsrs/web-transport-iroh/src/session.rsrs/web-transport-noq/src/session.rsrs/web-transport-quiche/src/connection.rsrs/web-transport-quinn/src/session.rsrs/web-transport-trait/src/lib.rs
| #[error("invalid path: {0:?}")] | ||
| InvalidPath(String), |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Adding a new public Error variant is a semver break.
qmux::Error is public, so downstream exhaustive matches stop compiling once InvalidPath exists. The PR objectives say qmux stays at 0.3.1 with no changelog/version update, so this ships a breaking API change as a non-breaking release. Either bump the crate version/changelog or preserve the existing public error surface.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@rs/qmux/src/error.rs` around lines 54 - 55, The public qmux::Error enum is
being extended with a new InvalidPath variant, which changes the exhaustive
match surface for downstream users. Either avoid exposing this as a new public
variant in Error, or update the crate version/changelog to reflect the breaking
API change before shipping. Locate the change in the Error enum in error.rs and
keep the public error surface stable if this release is meant to remain
non-breaking.
|
|
||
| /// Requested resource path, for transports without a URL of their own. | ||
| /// | ||
| /// QMux-specific (ID 0x2b9a4c1f6e3d8052). WebTransport over HTTP/3 and | ||
| /// WebSocket carry the path in the request line (`:path` / the WS URL); | ||
| /// TCP, TLS, and Unix sockets have no such field, so a client that needs to | ||
| /// address a specific resource sends it here. `None` (the default) omits the | ||
| /// parameter entirely, keeping peers that never set a path byte-identical. | ||
| pub path: Option<String>, |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
TransportParams gained a public field without a version bump.
Because TransportParams is public, adding path breaks downstream code that constructs or pattern-matches the struct exhaustively. With qmux intentionally left at 0.3.1, this is another breaking API change that needs a version/changelog update or a non-breaking API shape.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@rs/qmux/src/proto/params.rs` around lines 31 - 39, `TransportParams` now
exposes a new public `path` field, which is a breaking API change for downstream
construction and exhaustive matching. Either update the qmux version/changelog
to reflect the breaking change, or adjust the API shape in `TransportParams` to
remain backward-compatible (for example by avoiding a new public field on the
struct). Use the `TransportParams` definition in `params.rs` as the place to
make the change and ensure the release notes/versioning match the public API
change.
|
Closing: we're keeping PATH purely at the MoQ layer instead. A raw iroh (or raw QUIC) session carries no request URI, so every moq-transport/moq-lite client must be able to send PATH in the MoQ SETUP anyway — which makes a transport-level (Written by Claude Opus 4.8) |
Summary
Adds a way for a generic consumer to read the request path a peer connected to, uniformly across transports, via a new trait method — and restores qmux's in-band path parameter so qmux carries one too.
This is the prerequisite for moq#1954 (moq-lite-05 PATH): with
Session::path(), moq-net reads the path from the transport where it carries one (WebTransport's CONNECT:path, the qmux path param) and only falls back to its own in-band SETUP for raw QUIC — instead of guessing by URL scheme.What changed
web-transport-trait: newfn path(&self) -> Option<&str>default method (returnsNone), companion toprotocol(). The request path the peer connected to, for transports that carry one.qmux: reverts feat(qmux): remove the in-band path transport parameter #266 to restore the in-bandpathtransport parameter, theConfig::path()builders (tcp/uds/tls), andSession::path(), and wires it through the trait impl. The 0.3.1 version/changelog are kept as-is (the revert is code-only).web-transport-quinn/-quiche/-noq: return the CONNECT request's url path.web-transport-iroh: returns the HTTP/3 request path;Nonefor a raw iroh session (no CONNECT).Notes for review
path()is a defaulted trait method, so it's non-breaking for existingSessionimpls.path()staysNone, which is the signal moq-net uses to send its SETUP PATH instead.Follow-up
These crates need a release (
web-transport-trait,qmux, and the four backends) before moq#1954 can drop its local[patch]and bump to them.🤖 Generated with Claude Code