Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
c5f4162
chore(quest): claim quest/m1/datagram-tracks/README.md
kixelated Nov 6, 2026
6a48acc
test(net)!: Rust-JS datagram tracks on lite-07, direct and through a …
kixelated Nov 6, 2026
0b98ca5
fix: the TLS authority tests' server speaks QMux; type the ponyfill's…
kixelated Nov 6, 2026
1e64311
test: QMux fakes send their transport parameters; the oversized-frame…
kixelated Nov 6, 2026
c305497
fix(p2p): a started session settles the transport's closed; tests fol…
kixelated Nov 6, 2026
4e7675f
fix(tokio): the WebSocket accept deadline bounds QMux establishment
kixelated Nov 6, 2026
db8e2ea
docs(qmux): leave MIGRATE.md to the release cut
kixelated Nov 6, 2026
2d9c431
Merge origin/main into quest/m1/datagram-tracks/README
pullfrog[bot] Nov 6, 2026
846df39
test(tokio): set the QMux accept deadline through the server
pullfrog[bot] Nov 6, 2026
ac8e0b9
Merge remote-tracking branch 'origin/main' into t3/446f5f79
kixelated Nov 6, 2026
fb3619f
quest: drop the stale datagram-tracks prose in recut-held and net-wrap
kixelated Nov 6, 2026
04cf7c4
fix(qmux): bound ready with a handshake deadline; snapshot queued chu…
kixelated Nov 6, 2026
e976838
fix(qmux): format and record the handshakeTimeout API
kixelated Nov 6, 2026
29761e2
test(p2p): a silent dialer closes at the handshake deadline
kixelated Nov 7, 2026
ae13f15
Merge remote-tracking branch 'origin/main' into t3/446f5f79
kixelated Nov 7, 2026
7037b54
Merge branch 'base' into pr-8054
Nov 7, 2026
aa27d68
test(qmux): send peer parameters before awaiting readiness
Nov 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/interop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ jobs:
run: nix develop --command just test max-age
shell: bash -leo pipefail {0}

- name: Datagram tracks
id: datagram-tracks
if: ${{ !cancelled() && steps.setup.outcome == 'success' }}
run: nix develop --command just test datagram-tracks
shell: bash -leo pipefail {0}

- name: Stream limits over WebSocket
id: stream-limits
if: ${{ !cancelled() && steps.setup.outcome == 'success' }}
Expand Down Expand Up @@ -217,6 +223,7 @@ jobs:
"Rust cache": "${{ steps.rust-cache.outcome }}",
"Playwright Chromium": "${{ steps.setup.outcome }}",
"Optional publisher retention": "${{ steps.max-age.outcome }}",
"Datagram tracks": "${{ steps.datagram-tracks.outcome }}",
"Stream limits over WebSocket": "${{ steps.stream-limits.outcome }}",
"Relay fills": "${{ steps.relay-fill.outcome }}",
"Receive credit recovery": "${{ steps.receive-credit.outcome }}",
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ jobs:
- "test/max-age/**"
- "test/portrait/**"
- "rs/moq-tokio/tests/integration/max_age.rs"
- "test/datagram-tracks/**"
- "rs/moq-tokio/tests/integration/datagram_tracks.rs"
- "test/stream-limits/**"
- "rs/moq-tokio/tests/integration/stream_limits.rs"
- "test/relay-fill/**"
Expand Down
35 changes: 17 additions & 18 deletions js/net/src/connection/connect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1063,12 +1063,7 @@ test("when the WebSocket wins, every WebTransport dial is closed", async () => {
const originalStream = native.WebSocketStream;
native.WebSocketStream = class {
url: string;
opened = sleep(Nano.fromMilli(Milli(100))).then(() => ({
readable: new ReadableStream(),
writable: new WritableStream(),
protocol: "qmux-01",
extensions: "",
}));
opened = sleep(Nano.fromMilli(Milli(100))).then(qmuxStreams);
closed = new Promise(() => {});
constructor(url: string) {
this.url = url;
Expand Down Expand Up @@ -1105,12 +1100,7 @@ test("when WebTransport and WebSocket open in the same turn, the one not chosen
const originalStream = native.WebSocketStream;
native.WebSocketStream = class {
url: string;
opened = opened.then(() => ({
readable: new ReadableStream(),
writable: new WritableStream(),
protocol: "qmux-01",
extensions: "",
}));
opened = opened.then(qmuxStreams);
closed = new Promise(() => {});
constructor(url: string) {
this.url = url;
Expand Down Expand Up @@ -1229,6 +1219,20 @@ test("an invalid timeout throws before touching the caller's signal", async () =
await expect(connect(url, { timeout: -1 as Milli })).rejects.toThrow("invalid time: -1");
});

/** An opened WebSocketStream whose QMux server sent only its TRANSPORT_PARAMETERS (all
* defaults), which a session's `ready` waits for. */
function qmuxStreams() {
Comment thread
kixelated marked this conversation as resolved.
Resolved
return {
readable: new ReadableStream({
start: (controller) =>
controller.enqueue(new Uint8Array([0xff, 0x51, 0x53, 0x30, 0x0d, 0x0a, 0x0d, 0x0a, 0])),
}),
writable: new WritableStream(),
protocol: "qmux-01",
extensions: "",
};
}

type WebSocketDial = "hang" | "open" | { failAfter: Milli } | { openAfter: Milli };

// Their own host: a WebSocket that wins drops WebTransport's head start for its host and port afterwards.
Expand All @@ -1243,12 +1247,7 @@ function webSocketPlan(clock: Manual, plan: (dial: number) => WebSocketDial) {
const originalTransport = native.WebTransport;
native.WebTransport = undefined;
const dials: { at: number; closes: number }[] = [];
const streams = () => ({
readable: new ReadableStream(),
writable: new WritableStream(),
protocol: "qmux-01",
extensions: "",
});
const streams = qmuxStreams;
native.WebSocketStream = class {
url: string;
opened: Promise<unknown>;
Expand Down
18 changes: 11 additions & 7 deletions js/p2p/src/transport.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,18 @@ test("the accepting side stays silent until the dialer's first record proves its
await Promise.all([client.closed, server.closed]);
});

test("an accepted channel whose dialer stays silent still idles out without sending", async () => {
test("an accepted channel whose dialer stays silent closes at the handshake deadline without sending", async () => {
const clock = new Manual();
const installed = clock.install();
try {
const { left, right } = peers();
left.createDataChannel("moq", { ordered: true, protocol });
const server = Transport.accept({ peer: right.asPeer(), channel: right.incoming.asChannel(), protocol });
right.incoming.open();
// The session starts on open, so its 30 s idle deadline runs while its first write waits.
await server.ready;
// The idle check polls every 5 s and skips ticks a single long jump would miss.
for (let i = 0; i < 7; i++) await clock.advance(Nano.fromMilli(Milli(5_000)));
await expect(server.closed).rejects.toThrow("idle timeout");
// The session starts on open, so its 10 s handshake deadline runs while its first write
// waits on the silent dialer's parameters.
await clock.advance(Nano.fromMilli(Milli(11_000)));
await expect(server.closed).rejects.toThrow("handshake timeout");
expect(right.incoming.records).toEqual([]);
expect(right.incoming.listeners.size).toBe(0);
} finally {
Expand All @@ -129,7 +128,12 @@ test("an accepted side that closes before hearing its dialer still closes gracef
mock.left.channel.stream = false;
mock.left.channel.open();
mock.right.incoming.open();
await server.ready;
// Its `ready` waits for the dialer's lost parameters. The datagram writable starts once
// the session exists, which then starts on the open channel in pure microtask work.
const datagrams = server.datagrams.writable.getWriter();
await datagrams.ready;
datagrams.releaseLock();
for (let i = 0; i < 10; i++) await Promise.resolve();
server.close({ closeCode: 7, reason: "bye" });
// No clock advance: the close must not wait out qmux's flush timeout.
expect(await client.closed).toEqual({ closeCode: 7, reason: "bye" });
Expand Down
3 changes: 3 additions & 0 deletions js/p2p/src/transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ export class Transport implements WebTransport {
});
this.ready = this.#session.then((session) => session.ready);
void this.ready.catch((error) => {
// A session that started settles `closed` and closes the channel itself, gracefully
// when closed before its handshake finished. Only a channel that never opened has none.
if (this.#active) return;
this.#closed.reject(error);
this.#socket.close();
});
Expand Down
1 change: 1 addition & 0 deletions js/qmux/api/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface BidirectionalStream extends WebTransportBidirectionalStream {
}

export interface Config {
handshakeTimeout?: number | null;
idleTimeout?: number | null;
maxDatagramFrameSize?: bigint | null;
maxRecordSize?: bigint;
Expand Down
Loading
Loading