Skip to content

test(relay): cross-version qmux WebSocket backward-compat#1813

Closed
kixelated wants to merge 1 commit into
claude/eloquent-hamilton-db8452from
claude/qmux-backcompat-test
Closed

test(relay): cross-version qmux WebSocket backward-compat#1813
kixelated wants to merge 1 commit into
claude/eloquent-hamilton-db8452from
claude/qmux-backcompat-test

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Stacked on #1810 (needs the qmux 0.2.0 bump from that PR). Merge #1810 first, then rebase this onto main.

Why

The qmux 0.0.8 → 0.2.0 upgrade in #1810 touches the only transport with clients already deployed in the wild: WebSocket. These tests prove old clients still interop, and lock that in so a future qmux bump can't silently break them.

QUIC/WebTransport is unaffected (not qmux), and tcp:///unix:// are brand-new with no old peers — so WebSocket is the whole compatibility surface.

What's added

  • old_qmux_client_interops_over_websocket — the real test. Adds qmux 0.0.8 as a renamed dev-dependency (qmux_old) and connects an actual old client to a server running the current qmux with the relay's real supported_subprotocols(). Asserts:

    • they converge on the newest lite ALPN carried over the legacy qmux-00 wire (the old client only knows qmux-00, the server prefers qmux-01), and
    • a uni stream round-trips b"hello" — exercising qmux-00 frame encode (old) → decode (current) across the version gap.

    Both qmux versions depend on web-transport-trait = "0.3", so a single unified trait drives both sides — no two-trait plumbing.

  • advertises_legacy_subprotocols_for_old_clients — asserts the relay keeps advertising the bare webtransport / qmux-00 fallbacks and qmux-00.<newest-lite>, the subprotocols old browser/native clients depend on. A regression guard so a refactor (or version bump) can't drop them unnoticed.

Notes

  • This is the in-tree half of the "make sure we don't break old clients" plan. The other half (manual: old published @moq/watch against a branch-built relay; canary deploy) is operational and not in this PR.
  • Deeper qmux-00 framing edge cases are qmux's own test responsibility; this verifies the moq-relevant guarantee (negotiation + a stream round-trip end-to-end).

Test plan

  • cargo test -p moq-relay --lib websocket — both new tests pass alongside the existing negotiation test
  • cargo fmt --check + clippy --all-targets -D warnings

🤖 Generated with Claude Code

(Written by Claude)

Guard against the qmux 0.0.8 -> 0.2.0 bump (and future bumps) silently
breaking already-deployed clients over WebSocket:

- `old_qmux_client_interops_over_websocket`: an actual qmux 0.0.8 client
  (added as a renamed dev-dependency) connects to a server using the current
  qmux and the relay's real advertised subprotocols. They must converge on the
  newest lite ALPN over the legacy qmux-00 wire, and a uni stream must
  round-trip — exercising qmux-00 frame encode (old) -> decode (current). Both
  qmux versions share web-transport-trait 0.3, so one trait drives both sides.
- `advertises_legacy_subprotocols_for_old_clients`: asserts the relay keeps
  advertising the bare `webtransport`/`qmux-00` fallbacks and `qmux-00.<lite>`,
  the subprotocols old clients depend on.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@kixelated kixelated closed this Jun 19, 2026
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