Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
7f441ef
quest(m1/refresh/core): claim
kixelated Oct 19, 2026
39907ea
feat(net)!: track demand reports the wanted group, with refresh on join
kixelated Oct 19, 2026
c7a097f
fix: migrate the remaining demand callers and docs to wanted
kixelated Oct 19, 2026
f206e03
docs: link the demand migration to #5930
kixelated Oct 19, 2026
2c1f04c
Merge origin/main into quest/m1/refresh/core
kixelated Oct 19, 2026
2f52a8e
Merge remote-tracking branch 'origin/main' into refresh-core
kixelated Oct 19, 2026
be25ffa
feat(moq-c): report the wanted group and accept refresh
kixelated Oct 19, 2026
0f08b11
Merge branch 'main' of github.com:moq-dev/moq into refresh-core
kixelated Oct 19, 2026
53afd7e
fix(net): an absolute IETF SUBSCRIBE is no join
kixelated Oct 19, 2026
68ba537
Merge branch 'main' of github.com:moq-dev/moq into refresh-core
kixelated Oct 19, 2026
ac4e3f8
fix(net): an absolute SUBSCRIBE's NEW_GROUP_REQUEST asks as an update…
kixelated Oct 19, 2026
9147f40
Merge branch 'main' of github.com:moq-dev/moq into refresh-core
kixelated Oct 19, 2026
74357cd
Merge origin/main into quest/m1/refresh/core
kixelated Oct 19, 2026
1f0fb23
fix(net): a refresh join asks for the next free sequence
kixelated Oct 19, 2026
d37d6c0
Merge origin/main into quest/m1/refresh/core
kixelated Oct 19, 2026
b34d0e8
fix(net): read a pending refresh against the namespace
kixelated Oct 19, 2026
5c9fcce
Merge origin/main into quest/m1/refresh/core
kixelated Oct 19, 2026
cc9b39f
docs(net): clarify refresh migration notes; time only the join in the…
kixelated Oct 19, 2026
73f26f5
test(net): read JS resume track demand through wanted
kixelated Oct 19, 2026
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
4 changes: 2 additions & 2 deletions bench/browser/page/transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async function publish(config: Transport): Promise<void> {
const producer = origin.createBroadcast(Moq.Path.from(config.path));
// Retention covers the whole run, so a slow consumer cannot lose a group to eviction.
const track = producer.createTrack("data", { timescale: Moq.Time.Timescale.MILLI, maxAge: Milli(600_000) });
const demand = track.demand().used;
const demand = track.demand().wanted;
producer.announce();
const connection = await Moq.Connection.connect({
url: new URL(config.url),
Expand All @@ -50,7 +50,7 @@ async function publish(config: Transport): Promise<void> {
origin.close();
});
writer = (async () => {
while (!demand.peek() && track.closed.peek() === undefined)
while (demand.peek() === undefined && track.closed.peek() === undefined)
await Promise.race([demand.changed(), track.closed]);
if (track.closed.peek() !== undefined) return;
for (let start = 0; start < config.frames; start += config.group) {
Expand Down
7 changes: 7 additions & 0 deletions cpp/moq/MIGRATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ How to update your code for each breaking change, newest first.

## Unreleased

### Track demand reports the wanted group (#5930)

`TrackDemand::is_used`, `used`, and `unused` are gone.
`wanted()` returns `std::nullopt` while nobody subscribes, otherwise the group subscribers want next, and `wanted_changed()` waits for it to change (the first call returns at once).
Loop on `wanted_changed()` until it returns a value where you awaited `used()`, and `std::nullopt` where you awaited `unused()`.
`TrackInfo` gains `refresh`, the ratio past which a joining subscriber asks for a new group.

### `CongestionControl` gained `kNone` (#5926)

`moq::CongestionControl::kNone` runs no congestion control and no pacing, for tests and controlled links.
Expand Down
7 changes: 7 additions & 0 deletions dart/moq/MIGRATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ How to update your code for each breaking change, newest first.

## Unreleased

### Track demand reports the wanted group (#5930)

`TrackDemand.isUsed()`, `used()`, and `unused()` are gone.
`wanted()` returns null while nobody subscribes, otherwise the group subscribers want next, and `wantedChanged()` waits for it to change (the first call returns at once).
Loop on `wantedChanged()` until it returns non-null where you awaited `used()`, and null where you awaited `unused()`.
`TrackInfo` gains `refresh`. `GroupDemand` is unchanged.

### `CongestionControl` gained `none` (#5926)

`CongestionControl.none` runs no congestion control and no pacing, for tests and controlled links.
Expand Down
3 changes: 2 additions & 1 deletion dart/moq/test/moq_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ void main() {

// Routed subscriptions pull their source lazily when the consumer is first read.
final nextGroup = consumer.nextGroup();
await track.demand().used().timeout(timeout);
final demand = track.demand();
while (await demand.wantedChanged().timeout(timeout) == null) {}

final producer = track.appendGroup();
producer.writeFrame(
Expand Down
86 changes: 40 additions & 46 deletions dart/moq_ffi/lib/src/moq.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import "dart:ffi";
import "dart:io" show Platform, File, Directory;
import "dart:isolate";
import "dart:typed_data";

import "package:ffi/ffi.dart";

import "uniffi_runtime.dart";
export "uniffi_runtime.dart";

Expand Down Expand Up @@ -2577,10 +2579,12 @@ class FfiConverterMoqRoute {
class MoqTrackInfo {
final int priority;
final int? maxAgeUs;
final int? refresh;
final int? timescale;
MoqTrackInfo({
this.priority = 127,
this.maxAgeUs = null,
this.refresh = null,
this.timescale = null,
});
}
Expand All @@ -2602,6 +2606,11 @@ class FfiConverterMoqTrackInfo {
);
final maxAgeUs = maxAgeUs_lifted.value;
new_offset += maxAgeUs_lifted.bytesRead;
final refresh_lifted = FfiConverterOptionalUInt32.read(
Uint8List.view(buf.buffer, new_offset),
);
final refresh = refresh_lifted.value;
new_offset += refresh_lifted.bytesRead;
final timescale_lifted = FfiConverterOptionalUInt64.read(
Uint8List.view(buf.buffer, new_offset),
);
Expand All @@ -2611,6 +2620,7 @@ class FfiConverterMoqTrackInfo {
MoqTrackInfo(
priority: priority,
maxAgeUs: maxAgeUs,
refresh: refresh,
timescale: timescale,
),
new_offset - buf.offsetInBytes,
Expand All @@ -2621,6 +2631,7 @@ class FfiConverterMoqTrackInfo {
final total_length =
FfiConverterUInt8.allocationSize(value.priority) +
FfiConverterOptionalUInt64.allocationSize(value.maxAgeUs) +
FfiConverterOptionalUInt32.allocationSize(value.refresh) +
FfiConverterOptionalUInt64.allocationSize(value.timescale) +
0;
final buf = Uint8List(total_length);
Expand All @@ -2638,6 +2649,10 @@ class FfiConverterMoqTrackInfo {
value.maxAgeUs,
Uint8List.view(buf.buffer, new_offset),
);
new_offset += FfiConverterOptionalUInt32.write(
value.refresh,
Uint8List.view(buf.buffer, new_offset),
);
new_offset += FfiConverterOptionalUInt64.write(
value.timescale,
Uint8List.view(buf.buffer, new_offset),
Expand All @@ -2648,6 +2663,7 @@ class FfiConverterMoqTrackInfo {
static int allocationSize(MoqTrackInfo value) {
return FfiConverterUInt8.allocationSize(value.priority) +
FfiConverterOptionalUInt64.allocationSize(value.maxAgeUs) +
FfiConverterOptionalUInt32.allocationSize(value.refresh) +
FfiConverterOptionalUInt64.allocationSize(value.timescale) +
0;
}
Expand Down Expand Up @@ -8420,10 +8436,9 @@ class FfiConverterMoqGroupDemand {
}

abstract class MoqTrackDemandInterface {
bool isUsed();
String name();
Future<void> unused();
Future<void> used();
int? wanted();
Future<int?> wantedChanged();
}

final _MoqTrackDemandFinalizer = Finalizer<Pointer<Void>>((ptr) {
Expand Down Expand Up @@ -8457,47 +8472,37 @@ class MoqTrackDemand implements MoqTrackDemandInterface {
rustCall((status) => uniffi_moq_ffi_fn_free_moqtrackdemand(_ptr, status));
}

bool isUsed() {
String name() {
return rustCallWithLifter(
(status) => uniffi_moq_ffi_fn_method_moqtrackdemand_is_used(
(status) => uniffi_moq_ffi_fn_method_moqtrackdemand_name(
uniffiClonePointer(),
status,
),
FfiConverterBool.lift,
FfiConverterString.lift,
null,
);
}

String name() {
int? wanted() {
return rustCallWithLifter(
(status) => uniffi_moq_ffi_fn_method_moqtrackdemand_name(
(status) => uniffi_moq_ffi_fn_method_moqtrackdemand_wanted(
uniffiClonePointer(),
status,
),
FfiConverterString.lift,
FfiConverterOptionalUInt64.lift,
null,
);
}

Future<void> unused() {
Future<int?> wantedChanged() {
return uniffiRustCallAsync(
() =>
uniffi_moq_ffi_fn_method_moqtrackdemand_unused(uniffiClonePointer()),
ffi_moq_ffi_rust_future_poll_void,
ffi_moq_ffi_rust_future_complete_void,
ffi_moq_ffi_rust_future_free_void,
(_) {},
moqExceptionErrorHandler,
);
}

Future<void> used() {
return uniffiRustCallAsync(
() => uniffi_moq_ffi_fn_method_moqtrackdemand_used(uniffiClonePointer()),
ffi_moq_ffi_rust_future_poll_void,
ffi_moq_ffi_rust_future_complete_void,
ffi_moq_ffi_rust_future_free_void,
(_) {},
() => uniffi_moq_ffi_fn_method_moqtrackdemand_wanted_changed(
uniffiClonePointer(),
),
ffi_moq_ffi_rust_future_poll_rust_buffer,
ffi_moq_ffi_rust_future_complete_rust_buffer,
ffi_moq_ffi_rust_future_free_rust_buffer,
FfiConverterOptionalUInt64.lift,
moqExceptionErrorHandler,
);
}
Expand Down Expand Up @@ -15391,29 +15396,24 @@ external void uniffi_moq_ffi_fn_free_moqtrackdemand(
Pointer<RustCallStatus> uniffiStatus,
);

@Native<Int8 Function(Pointer<Void>, Pointer<RustCallStatus>)>(
@Native<RustBuffer Function(Pointer<Void>, Pointer<RustCallStatus>)>(
assetId: _uniffiAssetId,
)
external int uniffi_moq_ffi_fn_method_moqtrackdemand_is_used(
external RustBuffer uniffi_moq_ffi_fn_method_moqtrackdemand_name(
Pointer<Void> ptr,
Pointer<RustCallStatus> uniffiStatus,
);

@Native<RustBuffer Function(Pointer<Void>, Pointer<RustCallStatus>)>(
assetId: _uniffiAssetId,
)
external RustBuffer uniffi_moq_ffi_fn_method_moqtrackdemand_name(
external RustBuffer uniffi_moq_ffi_fn_method_moqtrackdemand_wanted(
Pointer<Void> ptr,
Pointer<RustCallStatus> uniffiStatus,
);

@Native<Pointer<Void> Function(Pointer<Void>)>(assetId: _uniffiAssetId)
external Pointer<Void> uniffi_moq_ffi_fn_method_moqtrackdemand_unused(
Pointer<Void> ptr,
);

@Native<Pointer<Void> Function(Pointer<Void>)>(assetId: _uniffiAssetId)
external Pointer<Void> uniffi_moq_ffi_fn_method_moqtrackdemand_used(
external Pointer<Void> uniffi_moq_ffi_fn_method_moqtrackdemand_wanted_changed(
Pointer<Void> ptr,
);

Expand Down Expand Up @@ -17797,17 +17797,14 @@ external int uniffi_moq_ffi_checksum_method_moqgroupdemand_unused();
@Native<Uint16 Function()>(assetId: _uniffiAssetId)
external int uniffi_moq_ffi_checksum_method_moqgroupdemand_used();

@Native<Uint16 Function()>(assetId: _uniffiAssetId)
external int uniffi_moq_ffi_checksum_method_moqtrackdemand_is_used();

@Native<Uint16 Function()>(assetId: _uniffiAssetId)
external int uniffi_moq_ffi_checksum_method_moqtrackdemand_name();

@Native<Uint16 Function()>(assetId: _uniffiAssetId)
external int uniffi_moq_ffi_checksum_method_moqtrackdemand_unused();
external int uniffi_moq_ffi_checksum_method_moqtrackdemand_wanted();

@Native<Uint16 Function()>(assetId: _uniffiAssetId)
external int uniffi_moq_ffi_checksum_method_moqtrackdemand_used();
external int uniffi_moq_ffi_checksum_method_moqtrackdemand_wanted_changed();

@Native<Uint16 Function()>(assetId: _uniffiAssetId)
external int uniffi_moq_ffi_checksum_method_moqflatesnapshotproducer_finish();
Expand Down Expand Up @@ -18448,16 +18445,13 @@ void _checkApiChecksums() {
if (uniffi_moq_ffi_checksum_method_moqgroupdemand_used() != 16710) {
throw UniffiInternalError.panicked("UniFFI API checksum mismatch");
}
if (uniffi_moq_ffi_checksum_method_moqtrackdemand_is_used() != 62559) {
throw UniffiInternalError.panicked("UniFFI API checksum mismatch");
}
if (uniffi_moq_ffi_checksum_method_moqtrackdemand_name() != 14603) {
throw UniffiInternalError.panicked("UniFFI API checksum mismatch");
}
if (uniffi_moq_ffi_checksum_method_moqtrackdemand_unused() != 32953) {
if (uniffi_moq_ffi_checksum_method_moqtrackdemand_wanted() != 13310) {
throw UniffiInternalError.panicked("UniFFI API checksum mismatch");
}
if (uniffi_moq_ffi_checksum_method_moqtrackdemand_used() != 18944) {
if (uniffi_moq_ffi_checksum_method_moqtrackdemand_wanted_changed() != 29509) {
throw UniffiInternalError.panicked("UniFFI API checksum mismatch");
}
if (uniffi_moq_ffi_checksum_method_moqflatesnapshotproducer_finish() !=
Expand Down
Loading
Loading