From 83562f88b1989e10b1992911880eda8a32e2f696 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 1 Nov 2026 04:08:11 -0800 Subject: [PATCH 1/2] chore(quest): claim quest/m0/test-flakes-2/draft22-interop.md Quest-Claim: c148f8816d946158 From afaec4c1ba5d589cc543b1d35fb4c84c682a918b Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 1 Nov 2026 04:28:27 -0800 Subject: [PATCH 2/2] fix(net): keep current groups when widening IETF subscriptions Build range updates from their absolute group bounds instead of reusing the initial join's Next Object filter. Rejoining at a newer object resets a stream that readers are still draining, and a duplicate head fill cannot replace it. Keep the existing one-group fill and initial join behavior. Reproduced on main e02e26b4c27663208fcc8e8cf9271d968a81cffb with: just test interop --all --publishers rust,cpp --versions ietf Draft 22 failed six Rust publisher media cells with audio gaps after an invalid-range recovery FETCH. Drafts 18 and 20 passed. The simulated open-start update test also fails before this change, for bounded and unbounded ends. Co-Authored-By: GPT-6.1 Sol --- quest/m0/test-flakes-2/README.md | 1 - quest/m0/test-flakes-2/draft22-interop.md | 20 ------ rs/moq-net/src/ietf/subscriber.rs | 74 ++++++++++++++++------- 3 files changed, 52 insertions(+), 43 deletions(-) delete mode 100644 quest/m0/test-flakes-2/draft22-interop.md diff --git a/quest/m0/test-flakes-2/README.md b/quest/m0/test-flakes-2/README.md index f2b20490eed..8c533387830 100644 --- a/quest/m0/test-flakes-2/README.md +++ b/quest/m0/test-flakes-2/README.md @@ -58,4 +58,3 @@ Public API: none. Wire: none. - [IETF22 fallback](/quest/m0/test-flakes-2/ietf22-fallback.md) - an IETF22 browser viewer follows a fallback within the media lane's bound, keeping its session and its audio - [moq-relay's auth-trust test survives load](/quest/m0/test-flakes-2/relay-auth-trust.md) - it stops timing out on a busy host -- [Draft-22 interop with a native publisher](/quest/m0/test-flakes-2/draft22-interop.md) - no "invalid fetch range" or audio gap with a Rust or C++ publisher diff --git a/quest/m0/test-flakes-2/draft22-interop.md b/quest/m0/test-flakes-2/draft22-interop.md deleted file mode 100644 index 5d826b95ee2..00000000000 --- a/quest/m0/test-flakes-2/draft22-interop.md +++ /dev/null @@ -1,20 +0,0 @@ -# [S] Draft-22 interop with a native publisher holds - -## Goal - -Interop on moq-transport draft 22 with a Rust or C++ publisher stops failing -with "invalid fetch range" and an audio gap, or is shown not to reproduce on -current main. - -## Plan - -[moq-dev/moq#7085](https://github.com/moq-dev/moq/pull/7085) hit it and cited -`ffi-audio-gap.md`, which [moq-dev/moq#6990](https://github.com/moq-dev/moq/pull/6990) -deleted. [moq-dev/moq#7204](https://github.com/moq-dev/moq/pull/7204) has -since limited IETF publishers to one group of history, which may change it. -Reproduce on current main first. If it no longer reproduces, delete this quest -with that evidence; otherwise fix the range at its source. - -Decided 2026-10-30 (maintainer, /quest-plan of the 2026-10-30 /quest-complete follow-ups): ✅ new flake child / drop. - -Public API: none. Wire: none unless the fix shows a FETCH range bug. diff --git a/rs/moq-net/src/ietf/subscriber.rs b/rs/moq-net/src/ietf/subscriber.rs index bc81892ffdc..a79a2632770 100644 --- a/rs/moq-net/src/ietf/subscriber.rs +++ b/rs/moq-net/src/ietf/subscriber.rs @@ -3638,28 +3638,22 @@ impl Subscriber { _ => false, }; let ranges = if bounds != sent_bounds { - let mut join = if Filter::is_draft20(self.version) { - match subscribe_join(bounds.0, bounds.1, self.version) { - Ok(join) => join, - Err(err) => return Poll::Ready(End::Invalid(err)), - } - } else { - Join { - filter: match bounds { - (None | Some(0), None) => Filter::Unfiltered, - (start, end) => Filter::Absolute { - start: ietf::Location { - group: start.unwrap_or(0), - object: 0, - }, - end: end - .and_then(|end| end.checked_sub(1)) - .map(|group| ietf::EndLocation { group, object: None }), + // Widen from the requested group bounds, not a fresh Next Object edge: + // that would cut the unread tail of a group already in flight. + let mut join = Join { + filter: match bounds { + (None | Some(0), None) => Filter::Unfiltered, + (start, end) => Filter::Absolute { + start: ietf::Location { + group: start.unwrap_or(0), + object: 0, }, + end: end + .and_then(|end| end.checked_sub(1)) + .map(|group| ietf::EndLocation { group, object: None }), }, - fill: None, - fetch: false, - } + }, + ..Default::default() }; if widened && Filter::is_draft20(self.version) { join.fill = Some(ietf::Fill { @@ -3670,8 +3664,6 @@ impl Subscriber { group_order: Some(GroupOrder::Ascending), range_filters: false, }); - } else { - join.fill = None; } Some(join) } else { @@ -16596,6 +16588,44 @@ mod new_group_tests { relay.serving.abort(); } + /// Widening to an open start must retain the objects already being streamed. Next + /// Object would snapshot a later edge and cut that stream before its tail arrives. + #[kio::test] + async fn widening_to_an_open_start_does_not_rejoin_at_the_next_object() { + for end in [None, Some(7)] { + let (mut relay, mut first) = relay().await; + let (mut stream, _) = relay.accept().await; + accept(&mut stream, false, 5).await; + + first.update(track::Subscription::default().with_range(6..)).unwrap(); + let _ = read(&mut stream).await; + answer(&mut stream).await; + + let wanted = track::Subscription::default(); + let wanted = match end { + Some(end) => wanted.with_range(..end), + None => wanted, + }; + first.update(wanted).unwrap(); + let (id, body) = read(&mut stream).await; + assert_eq!(id, ietf::SubscribeUpdate::ID); + let msg = ietf::SubscribeUpdate::decode_msg(&mut body.decoder(VERSION), VERSION).unwrap(); + let expected = match end { + None => ietf::Filter::Unfiltered, + Some(end) => ietf::Filter::Absolute { + start: ietf::Location { group: 0, object: 0 }, + end: Some(ietf::EndLocation { + group: end - 1, + object: None, + }), + }, + }; + assert_eq!(msg.filter, Some(expected)); + assert_eq!(msg.fill.unwrap().filter, Some(ietf::Filter::Relative(1))); + relay.serving.abort(); + } + } + /// Delayed headers, including one already waiting for REQUEST_OK, belong to the /// request they answer and cannot consume a later widening's fill. #[kio::test]