Skip to content

moqt: interop shim — tolerate REQUEST_OK on a fetch request stream (moq-dev relay FETCH stub) #5

Closed

Description

@mmcc

Symptom

With #4 fixed, playback against a moq-dev (kixelated/moq) relay still fails: the MSF catalog joining FETCH is answered and the engine closes the session:

closed: code=3 reason=unexpected request-ok on a fetch request stream

Root cause (theirs, not ours)

moq-dev's relay is spec-noncompliant here, on two counts (observed at 8c4b0801, rs/moq-net/src/ietf/publisher.rs run_fetch_stream / write_fetch_ok):

  1. It answers FETCH with a generic REQUEST_OK (0x07) for drafts 17+, where draft-19 is unambiguous:
    • §5.2: 'The publisher MUST send exactly one FETCH_OK or REQUEST_ERROR in response to a FETCH.'
    • §10.5 lists the requests REQUEST_OK answers — FETCH is deliberately absent (FETCH_OK carries End Location / group order / end-of-track, which the gap-inference rules in §10.12 depend on).
  2. Its fetch data stream is always empty (FetchHeader + immediate FIN) — cached objects are never replayed. Standalone and absolute-joining fetches are rejected outright (error 500); only relative-joining at offset 0 is accepted.

The engine's strictness is correct spec enforcement. But the engine cannot simply skip the FETCH either: MSF §5 mandates it ('Subscribers accessing the catalog MUST use SUBSCRIBE with a Joining FETCH (offset = 0)'), and against compliant relays it is the only way a late joiner gets the current catalog.

Proposed shim

In session.ts #handleFetchMessage, accept request-ok as if it were an empty-range FETCH_OK (endOfTrack: false, endLocation: {group: 0, object: 0}), and log a prominent warning when the tolerance fires. Explicitly comment it as a moq-dev interop shim to be removed once their write_fetch_ok is fixed upstream (they already define and round-trip-test a proper FetchOk for earlier drafts).

  • Dormant against compliant relays — a real FETCH_OK never takes this path, and we keep sending the joining FETCH, so the MSF MUST stays satisfied.
  • Caveat the warning exists for: playback works against moq-dev only because their subscribe over-delivers (replays the current group from object 0 even on a largest-object subscription), so the catalog arrives via SUBSCRIBE and the empty fetch is harmless. A relay that stubs FETCH and filters strictly would still stall with no catalog — the warning keeps that diagnosable.

Verification

With this shim + #4 applied to the demo bundle: relay-rs test publisher → relay.mux.dev → SPF player renders live video in the headless-Chromium harness (2135/4096 canvas pixels changed, stable playback at the live edge of a 21-minute-old broadcast, 0.28 s latency); same result against a local moq-relay built from 8c4b0801. Details in muxinc/relay-rs docs/interop.md § 'moq-dev relay interop' (branch moq-dev-moq-pub).

🤖 Generated with Claude Code

Activity

  1. mmcc commented on Oct 27, 2026

    @mmcc
    OwnerAuthor

    No longer applies on mmcc/moq. Since the moqt-20 move (#41), the player joins the catalog with a relative-group 1 subscription filter and sends no FETCH, so a relay answering FETCH with REQUEST_OK can't end the session. The local codec was replaced by @caprid/moq-core in #75.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions