Skip to content

fix(moq-transport): forward Track Properties through relays - #278

Open
nnazo wants to merge 3 commits into
cloudflare:mainfrom
nnazo:nnazo/track-properties
Open

nnazo wants to merge 3 commits into
cloudflare:mainfrom
nnazo:nnazo/track-properties

Conversation

@nnazo

@nnazo nnazo commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Relays built on moq-transport now forward Track Properties. Until now moq-relay-ietf dropped them: every downstream SUBSCRIBE_OK went out with an empty set, a PUBLISH carrying any property other than DEFAULT_PUBLISHER_PRIORITY was refused with NOT_SUPPORTED, and generated PUBLISH and TRACK_STATUS_OK carried none. Draft 18 requires a relay to cache and forward properties it does not understand, and to include them in PUBLISH, SUBSCRIBE_OK, TRACK_STATUS_OK and FETCH_OK (sections 2.5 and 9.6).

The served track now holds the property set it received from upstream SUBSCRIBE_OK or inbound PUBLISH, so cache hits and rendezvous releases send the same bytes as the first answer. Values are kept as received, including the inner bytes of Immutable Properties. The four commits add this per message, then handle Mandatory Track Properties (section 2.5.1) and the value limits in sections 12.4 to 12.6, searching Immutable Properties as section 12.7 requires.

RequestOk gains a public track_extensions field, so struct literals no longer compile. RequestOk::new(id, params) builds one without properties. Messages without properties are unchanged on the wire.

Four items where draft 18 is silent or ambiguous, and what this change does:

  • A PUBLISH or a pending SUBSCRIBE whose Immutable Properties cannot be parsed is refused with MALFORMED_TRACK (0x12). Section 10.6 defines that code only for FETCH.
  • When a single-valued property is both at the top level and inside Immutable Properties, the top-level value wins.
  • Section 10.5 does not list the SUBSCRIBE_TRACKS response among the REQUEST_OKs whose properties must be empty. It is sent empty and not checked on receipt.
  • A 0x0B nested inside Immutable Properties in Track Properties is accepted, since section 12.7 rejects that only for Objects.

A Mandatory Track Property sent as an Object Property (section 2.5.1) is not handled yet; that is data-path work for a follow-up.

@nnazo
nnazo force-pushed the nnazo/track-properties branch from c51830d to 805f6d4 Compare October 16, 2026 18:35
@nnazo
nnazo changed the base branch from draft-18-dev to main November 14, 2026 21:03
A PUBLISH carrying properties other than DEFAULT_PUBLISHER_PRIORITY and
DYNAMIC_GROUPS was refused with NOT_SUPPORTED. Draft 18 requires a relay
to cache and forward properties it does not support (Sections 2.5 and 9.6).
Accept non-mandatory properties into the track's existing shared state,
so downstream SUBSCRIBE_OK and generated PUBLISH carry the complete set.

Refuse a PUBLISH with a Mandatory Track Property (0x4000-0x7FFF), at the
top level or inside Immutable Properties, with UNSUPPORTED_EXTENSION.
Draft 18 registers no supported mandatory type. Refuse unparseable
Immutable Properties with MALFORMED_TRACK, which Section 10.6 defines
only for FETCH. Neither refusal closes the session or reserves the
track's name or alias. Stored immutable bytes stay unchanged.

remote: track-properties
A peer's TRACK_STATUS_OK with properties failed to decode because
RequestOk had no field for them. Draft 18 ends every REQUEST_OK with
Track Properties, populated in TRACK_STATUS_OK (Sections 9.6, 10.5 and
10.14). Carry them after the parameters in RequestOk and both codecs.
Empty sets add no bytes, preserving other responses' wire output.
Close the session with PROTOCOL_VIOLATION when PUBLISH_OK,
PUBLISH_NAMESPACE_OK, SUBSCRIBE_NAMESPACE_OK or REQUEST_UPDATE_OK carries
properties, as Section 10.5 requires. Its list omits the SUBSCRIBE_TRACKS
response, so that response is sent empty and not checked.

BREAKING CHANGE: RequestOk has a new public field, track_extensions, so
struct literals no longer compile. RequestOk::new(id, params) builds a
response without properties.

remote: track-properties
@nnazo
nnazo force-pushed the nnazo/track-properties branch from 805f6d4 to 445ad71 Compare November 14, 2026 21:24
…ties

A SUBSCRIBE_OK or FETCH_OK carrying a Mandatory Track Property
(0x4000-0x7FFF) was accepted and its track forwarded. Refuse such tracks
with Closed(0x33), or Closed(0x12) for unparseable Immutable Properties.
Cancel the upstream request and fail pending downstream requests with
that code, resetting a fetch stream if data has been forwarded
(Sections 2.5.1 and 12.7).

Known-value checks read only the first top-level value, and publisher
group order was checked only on FETCH_OK. Validate every readable known
value on PUBLISH, SUBSCRIBE_OK, TRACK_STATUS_OK and FETCH_OK before
track-scoped refusal, closing the session for out-of-range values.
Search Immutable Properties one level deep in the typed getters, with
mutable values taking precedence. An immutable default priority applies
to the track's subgroups and datagrams; immutable bytes stay unchanged.

remote: track-properties
@nnazo
nnazo force-pushed the nnazo/track-properties branch from 445ad71 to b20c7b7 Compare November 14, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant