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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# [S] moq-audio: held resampler frames keep their source timestamp

## Goal

`decode::Consumer` stamps resampled output where its first sample came from,
in every phase, instead of subtracting held-frame counts from the newest
packet's timestamp. A forward gap can no longer place audio up to a packet
away from where it belongs, and `Frame::activity`, keyed by the same stamp,
labels the right span.

## Plan

`starts_at` in `rs/moq-audio/src/decode/consumer.rs` rewinds the current
packet's `decoded_at` by `pending` input frames and `skipped` startup frames;
`Resampler` in `rs/moq-audio/src/resample.rs` exposes only counts
(`pending_frames`, `skipped`), never where the held samples came from. #3386
mitigated the reported case on both branches: `Consumer::read` detects an
undeclared hole before decoding (`discontinuous(next, mux_frame.timestamp)`),
drains the resampler through `gap()`, and stamps the tail from the pre-gap
`tail`. Two holes remain: the gap check is skipped once `self.end` is set (the
terminal phase), and a jump inside `discontinuous()`'s slack still rewinds
across silently.

- The resampler records the source timestamp of the oldest held input frame,
fed alongside the samples, and `starts_at` reads it; the `skipped` startup
frames rewind from that.
- Delete the derived subtraction; `pending_frames` stays for the drain
accounting.
- Regression: a 10 ms packet at 0 leaves 10 ms held, the next packet lands at
1 s, and the output is stamped from 0 rather than near 990 ms, in the
terminal phase too, with the activity span labelled from the held packet.
Cover a jump inside the slack.
- [Duration marker](/quest/m2/duration-marker.md) removes the audio end marker
and the terminal phase; whichever lands second simplifies the other.

## Closes

- [#3326](https://github.com/moq-dev/moq/issues/3326) - close this issue when the quest finishes

## Related

- [Duration marker](/quest/m2/duration-marker.md) - removes the terminal phase this quest has to cover
38 changes: 0 additions & 38 deletions quest/m0/3359-moq-net-subscribe-error-sends-hardcoded-404.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# [XS] js: every @moq package a package imports is a declared dependency

## Goal

No published `@moq/*` package imports another `@moq/*` package it does not
declare, and a check keeps it that way. `@moq/watch` on Firefox 140 ESR either
plays or fails with a mechanism named in #3361.

## Plan

`js/watch/src/broadcast.ts` imports `@moq/json` (`new
Json.Snapshot.Consumer(...)` in `#runCatalog`), but `js/watch/package.json`
does not declare it. `js/watch/vite.config.ts` externalizes every `@moq/*`
import, so the published bundle resolves it only through hoisting from
`@moq/hang`. A consumer whose resolver stubs it gets `Json.Snapshot` undefined
and exactly the reported `can't access property "Consumer", (void 0) is
undefined` inside an effect. The import predates 0.3.2, so it is not the
whole story: the only Firefox-relevant change between 0.3.2 and 0.5.2 is the
bowser user-agent gate (#2943, a new CJS runtime dependency in js/net), and
Firefox 140 takes the WebSocket path either way.

- Declare `@moq/json` in js/watch with the workspace range, and audit the other
packages the same way.
- Add a check under `js/`, run by `just js check`, that every bare `@moq/*`
specifier under a package's `src/` appears in that package's dependencies
or peer dependencies. It fails on the current tree; fix what it finds.
- Reproduce on Firefox 140 ESR against `just relay` and `just pub bbb` with a
source map. If the undeclared dependency was the mechanism, close; otherwise
record the real stack in the issue and rescope.
- Firefox is not in the browser harness: add it to `test/wasm`'s Playwright
matrix if the harness can drive it, or record why it cannot.

## Closes

- [#3361](https://github.com/moq-dev/moq/issues/3361) - close this issue when the quest finishes
27 changes: 0 additions & 27 deletions quest/m0/3361-js-watch-fails-on-firefox-esr.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# [S] js/watch: a broadcast republished under its name on one session keeps resuming

## Goal

A watcher of a broadcast that its publisher drops and republishes under the
same name on the same session re-consumes every generation, not just the
first. The reported shape is an `invisible` `<moq-publish>` toggling `muted`:
with no media left the element unpublishes, and each unmute publishes again.

## Plan

Reported on `@moq/watch` 0.3.2 (#3363); nobody has retested 0.5.3, and three
fixes since target this path: #2617 (`announcedBroadcast`, lite restarts
resolved by publisher identity), #2976 (keep a republished broadcast when its
predecessor closes), #3368 (a refused duplicate namespace does not strand the
first).

Mechanism on main: `js/publish/src/element.ts` derives `hasMedia` from the
audio and video sources, and `Microphone` stops its track when `muted`, so an
`invisible` publisher with `muted` set has no media and `#publishEnabled` goes
false; `js/publish/src/broadcast.ts` `Broadcast.#run` closes the
`Moq.Broadcast.Producer` (the broadcast is unannounced), and unmute creates a
fresh producer and calls `connection.publish(name, broadcast)` again. The
watcher's `js/watch/src/broadcast.ts` `#runBroadcast` delegates to
`conn.announcedBroadcast(name)`, and `js/net/src/announced.ts` keeps a live
handle across a redundant re-announce (`current.closed.peek() === undefined`
continues). If the retraction is coalesced away or lands late, the watcher
holds the dead generation and the wire resets its tracks: play, then close,
until a fresh session (a publisher reload) forces an unambiguous retraction.
dev's `#runBroadcast` builds on `Moq.Origin.Table` and `Announce.Broadcast`
instead, but the publisher chain and the audio source are the same.

- Regression first: a js/net test that publishes, unpublishes, and republishes
one path on one session three times, and asserts the announced-broadcast
handle re-consumes each generation and the audio track yields frames after
each. Run it on main (0.5.3) and dev.
- If it fails, key the re-announce on a generation identity so an announce
that follows a retraction always swaps the handle. If it passes, keep the
test and close.
- Manual check per the issue: `just relay`, an `invisible muted`
`<moq-publish>` toggling `muted`, a `<moq-watch>` on the same name.

## Closes

- [#3363](https://github.com/moq-dev/moq/issues/3363) - close this issue when the quest finishes

## Related

- [#2985](/quest/m1/2985-js-net-path-keyed-publisher-state-goes-stale-when-a.md) - the publisher side of a same-path replacement
- [#2991](/quest/m1/2991-net-coalesce-dynamic-tracks-and-preserve-sequences-across.md) - sequences across replacements
32 changes: 0 additions & 32 deletions quest/m0/3363-js-watch-audio-only-stream-does-not-resume.md

This file was deleted.

8 changes: 4 additions & 4 deletions quest/m0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ regression test per Root Cause First.
## Quests

- [#2405](/quest/m0/2405-js-net-connect-logs-on-every-connection-at-the-wrong.md) - js/net: connect logs print the JWT in the relay URL
- [#3361](/quest/m0/3361-js-watch-fails-on-firefox-esr.md) - js/watch: `<moq-watch>` throws from an effect on Firefox ESR, a regression since 0.3.2
- [#3360](/quest/m0/3360-js-watch-broadcast-is-undefined-at-initialization.md) - js/watch: a framework binding the element reads `broadcast` before the custom element is upgraded
- [#3363](/quest/m0/3363-js-watch-audio-only-stream-does-not-resume.md) - js/watch: an audio-only stream resumes only the first time the publisher unmutes
- [#3359](/quest/m0/3359-moq-net-subscribe-error-sends-hardcoded-404.md) - moq-net: SUBSCRIBE_ERROR sends a literal 404 instead of the draft's registered code
- [Adapter namespace map](/quest/m0/rs-adapter-namespace-map.md) - moq-net: a duplicate PUBLISH_NAMESPACE on draft-14/15 strands the first request, and the map never shrinks
- [IETF error codes](/quest/m0/ietf-error-codes.md) - every code on a moq-transport wire is a registered value for the negotiated draft, requests and stream resets alike
- [Resume info](/quest/m0/resume-info-newest.md) - moq-net: resume reports segment zero's track info, so a replaced broadcast rescales timestamps on the predecessor's timescale
- [#3080](/quest/m0/3080-fix-watch-audio-ring-truncate-can-race-the-worklet-reader.md) - watch: an audio ring truncate can race the worklet reader for one quantum
- [#3291](/quest/m0/3291-moq-net-zero-budget-shedding-drops-discontinuity-markers.md) - moq-net (dev): zero-budget shedding drops the empty group that marks a codec reset
- [#3363](/quest/m0/3363-js-watch-a-broadcast-republished-on-one-session-keeps-resuming.md) - js/watch: a broadcast republished under its name on one session keeps resuming
- [#3361](/quest/m0/3361-js-every-moq-package-a-package-imports-is-declared.md) - js: every @moq package a package imports is a declared dependency
- [#2833](/quest/m0/2833-moq-export-ts-a-rewound-timeline-stalls-the-si-table.md) - moq export ts: a rewound timeline stalls SI tables, PCR, and pacing until the media clock catches up
- [#3326](/quest/m0/3326-moq-audio-held-resampler-frames-keep-their-source-timestamp.md) - moq-audio: held resampler frames keep their source timestamp
- [#2799](/quest/m0/2799-moq-video-capture-negotiates-twice-so-a-window-resize.md) - moq-transcode: the ladder follows a source resolution change instead of keeping the one it started with
- [Group charge](/quest/m0/group-charge.md) - charge real per-group cost so MOQ_CACHE_CAPACITY bounds real memory
- [uring all-features](/quest/m0/uring-all-features-build.md) - moq-uring does not compile with `--all-features`, so the nightly features gate fails on it
Expand Down
74 changes: 74 additions & 0 deletions quest/m0/ietf-error-codes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# [M] IETF error codes come from the draft registry

## Goal

Every error code moq-net and js/net put on a moq-transport wire is a
registered value for the negotiated draft, in both directions: the
SUBSCRIBE_ERROR, FETCH_ERROR, and REQUEST_ERROR payloads, and the RESET_STREAM
and STOP_SENDING codes on data and request streams. A relay built on these
crates passes the interop runner's subscribe-error and subscribe-before-announce
cases without the peer's compatibility branch, and a routine cancellation is
read as CANCELLED rather than INTERNAL_ERROR.

Boundaries: moq-lite's own code spaces are untouched, and js/net's inability to
carry a code on a locally raised stream error stays with
[JS stream codes](/quest/m1/js-net-stream-error-codes.md), which is about the
moq-lite space and the abstraction, not the registry.

## Plan

What the tree does today, identically on main and dev:

- `rs/moq-net/src/ietf/publisher.rs` `run_subscribe` rejects with the literal
`404` at three sites and `run_fetch_stream` with `500`;
`rs/moq-net/src/ietf/subscriber.rs` `write_error` uses `400`.
`reject_subscribe`, `reject_fetch`, and `write_error` take a bare `u64`, and
`ietf::SubscribeError`, `ietf::FetchError`, and `ietf::RequestError` carry a
bare `error_code`. The only named IETF code type is `TrackStatusCode`
(`rs/moq-net/src/ietf/track.rs`), for a different registry, plus a
function-local `NOT_SUPPORTED: u64 = 0x3` in the subscriber.
- `js/net/src/ietf/publisher.ts` `runSubscribe` writes `errorCode: 404` on both
the draft-14 `SubscribeError` and the draft-15+ `RequestError` branch;
`js/net/src/ietf/subscriber.ts` uses `400` and `409`; `errorCode` is a plain
number everywhere.
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
- `js/net/src/ietf/subscriber.ts` `runPublish` writes a draft-14 `PublishError`
with the function-local `NOT_SUPPORTED` and a `RequestError` on later
drafts; the Rust subscriber's publish handling is the same shape.
- Stream resets on an IETF session send `Error::to_code()`, the moq-lite space
where `Cancel` is `0`; draft-19 section 3.3.4 assigns `0x0` to INTERNAL_ERROR
and `0x1` to CANCELLED. `Error::from_transport` maps only `0` back to
`Cancel`, so both directions have to move together. #2993 fixed one site
(`cancel_subscribe`, a named `STREAM_CANCELLED`).
- `Version::Draft14` through `Draft20` are all negotiated, straddling the
draft-19 consolidation into REQUEST_ERROR, so the values are per version.

The work:

- One named code type per registry (request errors, stream errors), with
`Encode<Version>` and `Decode<Version>` in the `TrackStatusCode` style, that
maps `Error` variants to the registered value for the negotiated draft and
back. An incoming code with no named value decodes to the remote/opaque
variant, never to a named one. Cite the draft section each value comes from
in the type's docs.
- Use it at every construction site above, in Rust and JS, and in
`Reader::abort` / `Writer::abort` on IETF sessions. Delete the literals and
the function-local constant. `Error::NotFound`'s IETF wire value comes from
the same mapping.
- Tests: encode/decode round-trips per version; a draft-14 PublishError and a
draft-15+ RequestError round-trip for the publish path; a subscribe for a missing
broadcast rejects with the not-found value of each draft; a cancelled
subscription resets with CANCELLED and a moq-net peer reads it back as
`Cancel`; the two interop runner cases pass without their COMPAT branch.

The reporter of #3359 offered a PR and asked whether to prefer a version-aware
enum over a flat one: version-aware, per the above.

## Closes

- [#3359](https://github.com/moq-dev/moq/issues/3359) - close this issue when the quest finishes
- [#3001](https://github.com/moq-dev/moq/issues/3001) - close this issue when the quest finishes

## Related

- [JS stream codes](/quest/m1/js-net-stream-error-codes.md) - the moq-lite half for js/net
- [#3187](/quest/m1/3187-preserve-structured-protocol-error-codes-across-ffi-and-c.md) - the same codes crossing the FFI
Loading
Loading