From 9f99771aee81e60c5a96a31c037ad9968a59db29 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 30 Oct 2026 06:41:22 -0700 Subject: [PATCH 1/4] chore(quest): claim quest/m1/ietf-dynamic-groups-resume.md Quest-Claim: 43cbbf725b424859 From a018da2b254f1eadc99152ac3e4520c1db90b6f5 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 30 Oct 2026 06:49:35 -0700 Subject: [PATCH 2/4] fix(net): keep DYNAMIC_GROUPS through an opted-out draft-22 resume A resumed SUBSCRIBE of a lingering copy opts out of Track Properties on draft 22, so its SUBSCRIBE_OK carries none. That empty block became the properties a pause holds, so once the subscription paused as a TRACKS listing's entry, the REQUEST_UPDATE resuming it dropped NEW_GROUP_REQUEST even though the track declared DYNAMIC_GROUPS. The idle copy now keeps the properties its first answer declared, not just the timescale, and an opted-out answer takes them in its place. Co-Authored-By: Claude Opus 5.5 --- quest/m1/README.md | 1 - quest/m1/ietf-dynamic-groups-resume.md | 14 ---- rs/moq-net/src/ietf/subscriber.rs | 46 ++++++------- rs/moq-net/src/ietf/subscriber/tracks.rs | 84 ++++++++++++++++++++++++ 4 files changed, 107 insertions(+), 38 deletions(-) delete mode 100644 quest/m1/ietf-dynamic-groups-resume.md diff --git a/quest/m1/README.md b/quest/m1/README.md index fe863117b99..7792162a9cd 100644 --- a/quest/m1/README.md +++ b/quest/m1/README.md @@ -155,7 +155,6 @@ removed). - [Rust FETCH parity](/quest/m1/ietf-fetch-parity.md) - Rust finishes an answered joining FETCH's head, refuses a lost head with DOES_NOT_EXIST, and sends no timestamps without TIMESCALE, as the JS publisher does - [Rust cancels an unclaimed fill head when a subscription ends](/quest/m1/ietf-fill-end-cancel.md) - SUBSCRIPTION_ENDED cancels, not finishes, a fill no group was sent for, as in JS - [SUBSCRIBE honors the properties opt-out](/quest/m1/subscribe-timestamps.md) - the Rust publisher sends untimed objects to a SUBSCRIBE that declines Track Properties, and the Rust subscriber asks for them when it needs timestamps -- [A resumed untimed copy keeps DYNAMIC_GROUPS](/quest/m1/ietf-dynamic-groups-resume.md) - opting out of properties on a draft-22 resume no longer forgets DYNAMIC_GROUPS - [Rust marks a lost listed group unknown](/quest/m1/ietf-publisher-unknown-range.md) - the Rust IETF publisher sends End of Unknown Range for a listed group it can't serve, after the publisher's open quests land - [Native rung disable](/quest/m1/simulcast-rung-disable.md) - OBS stops sending the top renditions its grant cannot fund, as the Rust/FFI publishers do, and a shaped uplink through moq-ffi proves the resume - [Audio jitter target](/quest/m1/audio-jitter-target/README.md) - the playout target is default in both languages; a manual browser proof and a native trace replay remain diff --git a/quest/m1/ietf-dynamic-groups-resume.md b/quest/m1/ietf-dynamic-groups-resume.md deleted file mode 100644 index e534c2a5ccb..00000000000 --- a/quest/m1/ietf-dynamic-groups-resume.md +++ /dev/null @@ -1,14 +0,0 @@ -# [XS] A resumed untimed copy keeps DYNAMIC_GROUPS - -## Goal - -On moq-transport draft 22, a resumed copy of an untimed track that opts out of -Track Properties still knows the track's DYNAMIC_GROUPS, as its first -subscription did. - -## Plan - -Found in [moq-dev/moq#7085](https://github.com/moq-dev/moq/pull/7085): opting -out of properties on resume drops DYNAMIC_GROUPS along with TIMESCALE. Carry -it from the first subscription, or keep asking for it when the track has it. -Add a resume test on draft 22. diff --git a/rs/moq-net/src/ietf/subscriber.rs b/rs/moq-net/src/ietf/subscriber.rs index f70b2ec62b2..c15f6039353 100644 --- a/rs/moq-net/src/ietf/subscriber.rs +++ b/rs/moq-net/src/ietf/subscriber.rs @@ -724,7 +724,9 @@ struct Idle { /// Serves its cache misses with a group FETCH, subscribed or not. dynamic: track::Requests, demand: track::Demand, - timescale: Option, + /// The Track Properties the publisher declared for the copy. A resumed SUBSCRIBE that + /// opts out of them is answered without them, so the copy keeps these. + properties: ietf::Properties, /// The publisher ended the track, so a returning subscriber reads the copy as it is. finished: bool, } @@ -3105,6 +3107,8 @@ impl Subscriber { let order = aggregate.map(|s| s.order).unwrap_or_default(); // Without an Established subscription, a relay includes the request it holds. let new_group = target.new_group(); + // A resumed copy already knows the track, from the answer that accepted it. + let properties_wanted = matches!(target, Target::Request(_)); // Buffered only: the wait for the answer flushes it, so the local terminals still end a // request the peer's send window holds back. let written = match &held { @@ -3135,8 +3139,7 @@ impl Subscriber { group_order: order.into(), filter: join.filter, fill: join.fill, - // A resumed copy already knows the track, from the answer that accepted it. - properties_wanted: matches!(target, Target::Request(_)), + properties_wanted, forward: true, rendezvous: false, range_filters: false, @@ -3362,20 +3365,17 @@ impl Subscriber { properties, largest, } = accepted; - // What a pause holds again: the properties the track was listed with. - let held_properties = properties.clone(); - // A resumed copy opts out of the properties from draft-22, so it keeps the units it - // learned. Before that the answer declares them again. - let timescale = properties - .timescale - .or(resumed.as_ref().and_then(|idle| idle.timescale)); - let info = accepted_info( - &ietf::Properties { - timescale, - ..properties - }, - self.version, - ); + // A resumed SUBSCRIBE opts out of the properties from draft-22, so its answer carries + // none and the copy keeps the ones it learned. Before that the answer declares them + // again. A pause holds these too, so a later resume still knows DYNAMIC_GROUPS. + let properties = match &resumed { + Some(idle) if held.is_none() && !properties_wanted && ietf::Filter::is_draft22(self.version) => { + idle.properties.clone() + } + _ => properties, + }; + let timescale = properties.timescale; + let info = accepted_info(&properties, self.version); // The copy already holds the track: it is current again up to the answer's Largest // Location once the join's head lands or a newer group does, since leaving cut the // group it was in. @@ -3865,7 +3865,7 @@ impl Subscriber { messages, request_id, alias, - properties: held_properties, + properties: properties.clone(), owed: unanswered.load(Ordering::Relaxed), copy: Some(track.clone()), }; @@ -3874,7 +3874,7 @@ impl Subscriber { demand: track.demand(), track, dynamic, - timescale, + properties, finished: false, }); } @@ -3897,7 +3897,7 @@ impl Subscriber { demand: track.demand(), track, dynamic, - timescale, + properties, finished: true, }); } @@ -3925,7 +3925,7 @@ impl Subscriber { demand: track.demand(), track, dynamic, - timescale, + properties, finished: false, }) } @@ -4001,7 +4001,7 @@ impl Subscriber { Step::Fill(fill) => { let fetch = self.clone() - .serve_fill(broadcast_path.clone(), track_name.to_owned(), fill, idle.timescale); + .serve_fill(broadcast_path.clone(), track_name.to_owned(), fill, idle.properties.timescale); group_fetches.push(fetch); } Step::Subscribe => break true, @@ -4412,7 +4412,7 @@ impl Subscriber { demand: track.demand(), track, dynamic, - timescale: ok.properties.timescale, + properties: ok.properties, finished: false, }) } diff --git a/rs/moq-net/src/ietf/subscriber/tracks.rs b/rs/moq-net/src/ietf/subscriber/tracks.rs index 9aa4a9d9f82..79756675a03 100644 --- a/rs/moq-net/src/ietf/subscriber/tracks.rs +++ b/rs/moq-net/src/ietf/subscriber/tracks.rs @@ -1742,6 +1742,90 @@ mod tests { } } + /// A copy that learned DYNAMIC_GROUPS keeps it through a draft-22 resume that opts out of + /// the properties, so once that subscription pauses as the listing's entry, the + /// REQUEST_UPDATE resuming it still carries the group a join asked for. + #[moq_clock::test] + async fn a_paused_resume_that_opted_out_keeps_dynamic_groups() { + let version = Version::Draft22; + let mut h = harness(version); + let mut listing = h.establish().await; + let accept = |peer: memory::Session| async move { + let mut stream = moq_clock::timeout(TIMEOUT, Stream::accept(&mut Transport::new(peer), version)) + .await + .expect("no SUBSCRIBE") + .unwrap(); + let (id, body) = read(&mut stream).await; + assert_eq!(id, ietf::Subscribe::ID); + let msg: ietf::Subscribe = body.message(version).unwrap(); + (stream, msg.properties_wanted, msg.new_group) + }; + let subscribe_ok = |dynamic_groups| ietf::SubscribeOk { + track_alias: 3, + largest: Some(ietf::Location { group: 5, object: 0 }), + properties: ietf::Properties { + dynamic_groups, + ..Default::default() + }, + }; + let answer = ietf::RequestOk { + active: None, + largest: None, + }; + + // The first answer declares DYNAMIC_GROUPS, and group 5 lands with a delta. + let (track, first, _serving) = h.read_track("video").await; + let (mut stream, wanted, _) = accept(h.peer.clone()).await; + assert!(wanted); + write(&mut stream, ietf::SubscribeOk::ID, &subscribe_ok(true)).await; + let first = moq_clock::timeout(TIMEOUT, first).await.expect("never accepted").unwrap(); + let copy = h.subscriber.state.lock().subscribes.values().next().unwrap().producer.clone().unwrap(); + let mut group = copy.create_group(crate::model::group::Info { sequence: 5 }).unwrap(); + group.write_frame(None, b"key".as_slice()).unwrap(); + group.write_frame(None, b"delta".as_slice()).unwrap(); + + // A join past the ratio asks for group 6, which stays outstanding. + let join = track.subscribe(None).await.unwrap(); + settle().await; + let (id, body) = read(&mut stream).await; + assert_eq!(id, ietf::SubscribeUpdate::ID); + assert_eq!(body.message::(version).unwrap().new_group, Some(6)); + write(&mut stream, ietf::RequestOk::ID, &answer).await; + + // Everyone leaves, and the copy lingers. + drop((first, join)); + settle().await; + + // A returning reader resumes it, opting out of the properties: the answer has none. + let reader = track.subscribe(None); + let (mut stream, wanted, new_group) = accept(h.peer.clone()).await; + assert!(!wanted, "the resume opts out"); + assert_eq!(new_group, Some(6)); + write(&mut stream, ietf::SubscribeOk::ID, &subscribe_ok(false)).await; + let reader = moq_clock::timeout(TIMEOUT, reader).await.expect("never accepted").unwrap(); + + // Skipped in the listing, so this subscription becomes the entry and pauses. + let skipped = ietf::PublishSkipped { + suffix: Path::from_static(""), + track_name: "video".into(), + }; + write(&mut listing, ietf::PublishSkipped::ID, &skipped).await; + assert_eq!(event(&mut h.tracks).as_deref(), Some("+video")); + drop(reader); + let (id, body) = read(&mut stream).await; + assert_eq!(id, ietf::SubscribeUpdate::ID, "not paused"); + assert_eq!(body.message::(version).unwrap().forward, Some(false)); + write(&mut stream, ietf::RequestOk::ID, &answer).await; + + // The resume still asks for group 6, since the track declared DYNAMIC_GROUPS. + let _reader = track.subscribe(None); + let (id, body) = read(&mut stream).await; + assert_eq!(id, ietf::SubscribeUpdate::ID, "not resumed"); + let resume: ietf::SubscribeUpdate = body.message(version).unwrap(); + assert_eq!(resume.forward, Some(true)); + assert_eq!(resume.new_group, Some(6), "the pause forgot DYNAMIC_GROUPS"); + } + /// A listed track that finishes before its resume is answered goes back to lingering, and /// its waiting reader SUBSCRIBEs: the idle copy cannot place the end, which the SUBSCRIBE /// learns, rather than abort a clean finish. From 5ba1cfd1e53cef037696f3d64e7293eb26aa054e Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 30 Oct 2026 07:06:13 -0700 Subject: [PATCH 3/4] style(net): format the DYNAMIC_GROUPS resume test Co-Authored-By: Claude Opus 5.5 --- rs/moq-net/src/ietf/subscriber.rs | 9 ++++--- rs/moq-net/src/ietf/subscriber/tracks.rs | 32 ++++++++++++++++++++---- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/rs/moq-net/src/ietf/subscriber.rs b/rs/moq-net/src/ietf/subscriber.rs index c15f6039353..ada6cbfb368 100644 --- a/rs/moq-net/src/ietf/subscriber.rs +++ b/rs/moq-net/src/ietf/subscriber.rs @@ -3999,9 +3999,12 @@ impl Subscriber { match step { Step::Fill(fill) => { - let fetch = - self.clone() - .serve_fill(broadcast_path.clone(), track_name.to_owned(), fill, idle.properties.timescale); + let fetch = self.clone().serve_fill( + broadcast_path.clone(), + track_name.to_owned(), + fill, + idle.properties.timescale, + ); group_fetches.push(fetch); } Step::Subscribe => break true, diff --git a/rs/moq-net/src/ietf/subscriber/tracks.rs b/rs/moq-net/src/ietf/subscriber/tracks.rs index 79756675a03..3bddc159299 100644 --- a/rs/moq-net/src/ietf/subscriber/tracks.rs +++ b/rs/moq-net/src/ietf/subscriber/tracks.rs @@ -1778,8 +1778,21 @@ mod tests { let (mut stream, wanted, _) = accept(h.peer.clone()).await; assert!(wanted); write(&mut stream, ietf::SubscribeOk::ID, &subscribe_ok(true)).await; - let first = moq_clock::timeout(TIMEOUT, first).await.expect("never accepted").unwrap(); - let copy = h.subscriber.state.lock().subscribes.values().next().unwrap().producer.clone().unwrap(); + let first = moq_clock::timeout(TIMEOUT, first) + .await + .expect("never accepted") + .unwrap(); + let copy = h + .subscriber + .state + .lock() + .subscribes + .values() + .next() + .unwrap() + .producer + .clone() + .unwrap(); let mut group = copy.create_group(crate::model::group::Info { sequence: 5 }).unwrap(); group.write_frame(None, b"key".as_slice()).unwrap(); group.write_frame(None, b"delta".as_slice()).unwrap(); @@ -1789,7 +1802,10 @@ mod tests { settle().await; let (id, body) = read(&mut stream).await; assert_eq!(id, ietf::SubscribeUpdate::ID); - assert_eq!(body.message::(version).unwrap().new_group, Some(6)); + assert_eq!( + body.message::(version).unwrap().new_group, + Some(6) + ); write(&mut stream, ietf::RequestOk::ID, &answer).await; // Everyone leaves, and the copy lingers. @@ -1802,7 +1818,10 @@ mod tests { assert!(!wanted, "the resume opts out"); assert_eq!(new_group, Some(6)); write(&mut stream, ietf::SubscribeOk::ID, &subscribe_ok(false)).await; - let reader = moq_clock::timeout(TIMEOUT, reader).await.expect("never accepted").unwrap(); + let reader = moq_clock::timeout(TIMEOUT, reader) + .await + .expect("never accepted") + .unwrap(); // Skipped in the listing, so this subscription becomes the entry and pauses. let skipped = ietf::PublishSkipped { @@ -1814,7 +1833,10 @@ mod tests { drop(reader); let (id, body) = read(&mut stream).await; assert_eq!(id, ietf::SubscribeUpdate::ID, "not paused"); - assert_eq!(body.message::(version).unwrap().forward, Some(false)); + assert_eq!( + body.message::(version).unwrap().forward, + Some(false) + ); write(&mut stream, ietf::RequestOk::ID, &answer).await; // The resume still asks for group 6, since the track declared DYNAMIC_GROUPS. From a365e8a9cdb780266043ac7f865252c433cabd4c Mon Sep 17 00:00:00 2001 From: quest fixer Date: Sat, 31 Oct 2026 14:55:42 -0700 Subject: [PATCH 4/4] fix(net): follow base Filter helper rename --- rs/moq-net/src/ietf/subscriber.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rs/moq-net/src/ietf/subscriber.rs b/rs/moq-net/src/ietf/subscriber.rs index d0252d72454..49fa8bcfce7 100644 --- a/rs/moq-net/src/ietf/subscriber.rs +++ b/rs/moq-net/src/ietf/subscriber.rs @@ -3377,7 +3377,7 @@ impl Subscriber { // none and the copy keeps the ones it learned. Before that the answer declares them // again. A pause holds these too, so a later resume still knows DYNAMIC_GROUPS. let properties = match &resumed { - Some(idle) if held.is_none() && !properties_wanted && ietf::Filter::is_draft22(self.version) => { + Some(idle) if held.is_none() && !properties_wanted && ietf::Filter::is_draft20(self.version) => { idle.properties.clone() } _ => properties,