Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions quest/m1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ removed).
- [moq-c at parity](/quest/m1/c/README.md) - the hand-written `moq-c` ships at the cut with every m1 binding feature moq-ffi gains
- [Lite-05/06 timestamps pass through](/quest/m1/lite-timestamps-through.md) - a timed track received over lite-05/06 stays timed and is forwarded with its timestamps over every version
- [Exact timestamps in every binding](/quest/m1/binding-timestamps.md) - bindings carry `{value, scale}` timestamps instead of lossy microseconds
- [Bindings see a moq-transport run end as an end](/quest/m1/ffi-ietf-run-end.md) - an IETF publisher ending its run reaches moq-ffi consumers as an end, not `Internal`
- [A broadcast stamps everything from one clock](/quest/m1/broadcast-clock.md) - catalog, MSF, and HLS record groups are stamped from the broadcast's clock, never the ambient one
- [A job's exact route continues its claim's readers](/quest/m1/announce-takeover.md) - a job's route inherits its claim's identity, replacing the ANNOUNCE_TAKEOVER predecessor design
- [Subscribe ranges](/quest/m1/subscribe-ranges/README.md) - a lite-07 SUBSCRIBE asks for past and live ranges with absolute or relative ends, in either order, and replaces FETCH; merged ranges never starve a subscriber; relays fill misses by range, including over moq-transport
Expand Down
30 changes: 30 additions & 0 deletions quest/m1/ffi-ietf-run-end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# [S] Bindings see a moq-transport run end as an end

## Goal

When a moq-transport publisher ends a run, a moq-ffi consumer (Python, Swift,
Kotlin, Go) sees the same kind of end it sees over moq-lite, not
`MoqError.Internal`. A binding can then follow a replaced publisher over
either protocol by error kind, without treating an IETF run's end as fatal.

## Plan

Decided 2026-10-31 (maintainer, /quest-plan of the follow-ups from
[moq-dev/moq.pro#3169](https://github.com/moq-dev/moq.pro/pull/3169)). That
PR's Go and Kotlin samples follow a lite run's end, which reaches the FFI as
a protocol reset (`MoqException.Protocol`), but over moq-transport the old
run's catalog ends with a stream reset that decodes as
`moq_net::Error::Remote(0)`. `rs/moq-net/src/error.rs` maps every `Remote(_)`
to `StreamError::Internal`, so the FFI raises `Internal` and the samples stop.
Comment on lines +16 to +18

@pullfrog pullfrog Bot Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mechanism here conflates two registries. moq_net::Error::Remote is only produced by the IETF request registry (request::from_code in rs/moq-net/src/ietf/error.rs, and PublishDone::end at rs/moq-net/src/ietf/publish.rs:175); a stream reset decodes through the stream registry (from_stream_code, rs/moq-net/src/ietf/error.rs:68), where 0x0 is StreamError::Internal, never Remote.

And 0x0 is INTERNAL_ERROR in every IETF registry we keep (rs/moq-net/src/ietf/error.rs:18, rs/moq-net/src/ietf/publish.rs:139), so it is an error, not a clean end. PublishDoneStatus::InternalError is what a track that ended with Err reports (rs/moq-net/src/ietf/publisher.rs:698), so a run end arriving as Remote(0) is a failure being signalled. The fix likely belongs at the source rather than a blanket Remote(0) -> end mapping in the Remote conversion, which would mask genuine internal errors and contradicts rs/moq-net/AGENTS.md (a session-close-induced end "ends with an error, never a clean end"): emit TrackEnded for a deliberate finish, or map the session-close-induced end to a session kind. Worth pinning the actual trigger down before committing to the mapping bullet.


- First establish what code 0 means on the moq-transport drafts we keep
([the IETF drop](/quest/m1/ietf-drop/README.md)): a clean end of the
publisher's run, or a real internal error. Only a code that means the run
ended maps to an end; others stay errors.
- Map it in one place (moq-net's `Remote` conversion or the FFI's
`From<moq_net::Error>`), keep the JS consumer consistent, and cover it with a
moq-transport publisher that ends a run under an FFI consumer.
- The broadcast-closed signal itself already shipped on main as
`MoqBroadcastConsumer.closed()`
([moq-dev/moq#7304](https://github.com/moq-dev/moq/pull/7304)); it reaches
the bindings with the next release, which moq.pro's reader quest adopts.