From 43fe46a02d8bdda79faabb39b62fedb701518537 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Wed, 28 Oct 2026 03:41:57 -0700 Subject: [PATCH 1/3] chore(quest): claim quest/m1/js-setup-rejection.md Quest-Claim: 62e2e3cba2a1efaa From f336e625eaad93a8d0af559a364ab75fd2f86eb7 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Wed, 28 Oct 2026 03:54:45 -0700 Subject: [PATCH 2/3] test(net): observe SETUP refusals before the peer's write can yield The shared stream write budget can yield a host task right after a SETUP write. Both moql SETUP refusal tests held the handshake promise unobserved across that write, so the refusal could land first and Bun reported it as an unhandled rejection. Observe each promise when it is created; the refusal assertions are unchanged. Co-Authored-By: Claude Opus 5.5 --- js/net/src/connection/connect.test.ts | 4 +++ quest/m1/README.md | 1 - quest/m1/js-setup-rejection.md | 38 --------------------------- 3 files changed, 4 insertions(+), 39 deletions(-) delete mode 100644 quest/m1/js-setup-rejection.md diff --git a/js/net/src/connection/connect.test.ts b/js/net/src/connection/connect.test.ts index aeef7bb808a..19db002e18b 100644 --- a/js/net/src/connection/connect.test.ts +++ b/js/net/src/connection/connect.test.ts @@ -455,6 +455,8 @@ test("a client refuses an IETF version selected in the moql SETUP", async () => const restore = stubWebTransport(pair.client); try { const connecting = connect(url, { websocket: { enabled: false } }); + // The SETUP write may yield a task, during which the refusal can already land. + void 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); @@ -468,6 +470,8 @@ test("a client refuses an IETF version selected in the moql SETUP", async () => test("a server refuses a client offering only IETF versions in the moql SETUP", async () => { const pair = createMockTransportPair(""); const accepting = accept({ url, transport: pair.server }); + // The SETUP write may yield a task, during which the refusal can already land. + void 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"); diff --git a/quest/m1/README.md b/quest/m1/README.md index 3f93058e5c5..09096f7e450 100644 --- a/quest/m1/README.md +++ b/quest/m1/README.md @@ -180,7 +180,6 @@ removed). - [An HLS viewer starts capture](/quest/m1/hls-record-demand.md) - a record-track subscriber counts as demand for its rendition's media - [One moq-ffi build definition](/quest/m1/ffi-build-flags.md) - every binding takes moq-ffi's default features from one place - [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 From 3d0b6212c9e812134c9a9b10da7504864c5eaf0f Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Wed, 28 Oct 2026 23:46:42 -0700 Subject: [PATCH 3/3] test(net): refuse every supported IETF draft in the moql SETUP The refusal tests used draft 14, which no longer exists anywhere, so a regression that let the `moql` SETUP negotiate a supported moq-transport draft would still pass. Run both sides over every `Ietf.Version`. Co-Authored-By: Claude Opus 5.5 --- js/net/src/connection/connect.test.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/js/net/src/connection/connect.test.ts b/js/net/src/connection/connect.test.ts index fb5679817c5..df56beebe2f 100644 --- a/js/net/src/connection/connect.test.ts +++ b/js/net/src/connection/connect.test.ts @@ -445,10 +445,10 @@ 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 { @@ -458,21 +458,21 @@ test("a client refuses an IETF version selected in the moql SETUP", async () => 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.