diff --git a/js/net/src/connection/connect.test.ts b/js/net/src/connection/connect.test.ts index 2458bb81de2..df56beebe2f 100644 --- a/js/net/src/connection/connect.test.ts +++ b/js/net/src/connection/connect.test.ts @@ -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. diff --git a/quest/m1/README.md b/quest/m1/README.md index a4eb7a3c4c9..a17fc6ee3d6 100644 --- a/quest/m1/README.md +++ b/quest/m1/README.md @@ -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 diff --git a/quest/m1/js-setup-rejection.md b/quest/m1/js-setup-rejection.md deleted file mode 100644 index 0481ea17ccb..00000000000 --- a/quest/m1/js-setup-rejection.md +++ /dev/null @@ -1,38 +0,0 @@ -# [M] A JS SETUP refusal has one rejection owner - -## Goal - -An IETF-only client offering its versions in a moql SETUP is refused with the -existing no-common-version error and close behavior. The expected refusal -never escapes as an unhandled promise rejection. - -## Plan - -Found during local full CI for -[moq-dev/moq#6983](https://github.com/moq-dev/moq/pull/6983), at -[moq-dev/moq@58027559e9](https://github.com/moq-dev/moq/commit/58027559e98fc806a0136680c6b2bbe5b1b9bd75), with Bun 1.4.2. The test -`a server refuses a client offering only IETF versions in the moql SETUP` -reported an unhandled `no common version found; client offered: ff00000e` -from `js/net/src/connection/accept.ts:187`. - -The failure is not reproduced: clean current main passed the focused test, -all 44 connection-file tests, and all 2,507 net-package tests. No matching -open quest or PR was found, including deleted quest history. -A [later report](https://github.com/moq-dev/moq/pull/6997#issuecomment-6459139941) -saw the same test fail twice, intermittently, while iterating on -[moq-dev/moq#6906](https://github.com/moq-dev/moq/pull/6906). - -Reproduce and trace rejection ownership before changing code. The test -creates `accepting = accept(...)`, then awaits `Stream.open` and -`ClientSetup.encode` before attaching `expect(accepting).rejects`. A late -handler is a hypothesis, not an established cause. Determine whether the -test or production owns the missing handler, and fix it at that boundary. -Preserve the existing refusal assertion, error, and close behavior; do not -add retries, sleeps, or an arbitrary run-count gate. - -Public API: none expected. Wire: none expected. Update existing documentation -inline only if the eventual fix changes what a caller must do. - -## Related - -- [Nonfinal JS drops](https://github.com/moq-dev/moq/pull/6983) - the full check that exposed the failure; its drop behavior is independent