Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 10 additions & 8 deletions js/net/src/connection/connect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,32 +445,34 @@ test("a peer without an ALPN is refused when no named version negotiates in SETU
}
});

// The moq-transport draft-14 version code, which the `moql` SETUP once also negotiated.
const DRAFT_14 = 0xff00000e;
// moq-transport negotiates only through its own ALPN, so the `moql` SETUP refuses every supported draft.
const IETF_VERSIONS = Object.values(Ietf.Version).map((v) => [Ietf.versionName(v), v] as const);

test("a client refuses an IETF version selected in the moql SETUP", async () => {
test.each(IETF_VERSIONS)("a client refuses %s selected in the moql SETUP", async (_, version) => {
const pair = createMockTransportPair("");
const restore = stubWebTransport(pair.client);
try {
const connecting = connect(url, { websocket: { enabled: false } });
// Handled now, since the refusal can land while the write below yields.
connecting.catch(() => {});
const stream = await Stream.accept(pair.server, Lite.DRAFT_02);
if (!stream) throw new Error("no SETUP stream");
await ClientSetup.decode(stream.reader);
await new ServerSetup(DRAFT_14).encode(stream.writer);
await expect(connecting).rejects.toThrow("unsupported server version: 0xff00000e");
await new ServerSetup(version).encode(stream.writer);
await expect(connecting).rejects.toThrow(`unsupported server version: 0x${version.toString(16)}`);
} finally {
restore();
}
});

test("a server refuses a client offering only IETF versions in the moql SETUP", async () => {
test.each(IETF_VERSIONS)("a server refuses a client offering only %s in the moql SETUP", async (_, version) => {
const pair = createMockTransportPair("");
const accepting = accept({ url, transport: pair.server });
// Handled now, since the refusal can land while the write below yields.
accepting.catch(() => {});
const stream = await Stream.open(pair.client, { version: Lite.DRAFT_02 });
await new ClientSetup([DRAFT_14]).encode(stream.writer);
await expect(accepting).rejects.toThrow("no common version found; client offered: ff00000e");
await new ClientSetup([version]).encode(stream.writer);
await expect(accepting).rejects.toThrow(`no common version found; client offered: ${version.toString(16)}`);
});

// The WebSocket subprotocols one connect() attempt asks a server for.
Expand Down
1 change: 0 additions & 1 deletion quest/m1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ removed).
- [Unbounded groups](/quest/m1/unbounded-groups/README.md) - groups and frames lose their size caps; the cache sheds parts of a group under pressure and refills the holes in place
- [Next Object on a cold Rust copy](/quest/m1/next-object-cold-copy.md) - a join after an upstream group report starts at the first frame received, never skipping
- [moqsrc max-delay](/quest/m1/gst-max-delay.md) - GStreamer's `moqsrc` takes a `max-delay` property instead of a hard-coded 1 s budget
- [JS SETUP rejection ownership](/quest/m1/js-setup-rejection.md) - reproduce an unhandled version-refusal rejection without weakening the refusal
- [moq-clock moves into kio::clock](/quest/m1/kio-clock.md) - moq-clock and its test macro become `kio::clock` and `#[kio::test]` before the cut publishes them
- [Poll-first async](/quest/m1/poll-first/README.md) - library crates compile no coroutines by default: async wrappers are generated from `poll_*` and gated behind an `async` feature
- [Every package's release backport ships](/quest/m1/release-versions.md) - a bot bumps every hand-versioned package changed on `release`, so backports publish without a manual bump
Expand Down
38 changes: 0 additions & 38 deletions quest/m1/js-setup-rejection.md

This file was deleted.

Loading