Skip to content

feat(gateway)!: align embedding APIs - #3818

Open
kixelated wants to merge 2 commits into
mainfrom
quest/m1/api-gateways
Open

kixelated wants to merge 2 commits into
mainfrom
quest/m1/api-gateways

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Problem

The gateway crates exposed stringly paths and durations, catch-all anyhow errors, and constructors that retained resources they only used when building routers. Their public shapes also diverged from moq-net and from each other.

Approach

  • Give RTMP, SRT, RTC, and HLS typed gateway errors; preserve underlying MoQ classifications.
  • Use PathOwned, Duration, and Url at gateway boundaries.
  • Move RTC origins to the publish/subscribe router calls and replace SRT dial free functions with a Client builder.
  • Add explicit SRT rejection verdicts with wire codes 1401, 1403, 1503, and 1400, including exact over-the-wire tests.
  • Namespace stats producer/consumer types and accept AsPath in room claims.
  • Update CLI consumers, examples, dependent docs, and remove the completed quest and its references.

Impact

This is a breaking Rust API change for moq-rtmp, moq-srt, moq-rtc, moq-hls, moq-stats, and moq-room. SRT handshake rejection wire behavior now carries the verdict-specific extended code. There is no MoQ wire-format change.

Alternatives

The SRT dial API could have retained free functions over a public config, but a Client keeps configuration private and matches the other gateway clients. HLS could have introduced a URL/path enum, but accepting Url directly keeps parsing at the caller boundary.

Testing

  • just check: passed.
  • Direct suites: moq-rtc 44/44, moq-rtmp 195/195, moq-hls 86/86, moq-room 15/15, and moq-srt 21/21 passed.
  • just test: 4,530 tests passed before an unrelated moq-uring worker setup failed with OS error 12 (Cannot allocate memory), cancelling 210 tests. The exact failed test passed when rerun alone.
  • just test smoke-full: 24/32 pairs passed. Both JS-native subscribers (Node and Bun) timed out against all four publishers after connecting and receiving the announcement; every Rust, Python, Go, JS, C, and GStreamer subscriber pairing passed.

Follow-ups

  • Investigate the systematic JS-native smoke subscriber timeout separately.
  • Rerun the full workspace test under a host with more available worker memory.

(written by GPT-5)

kixelated and others added 2 commits September 20, 2026 09:22
Co-Authored-By: GPT-5 <noreply@openai.com>
Co-Authored-By: GPT-5 <noreply@openai.com>
@kixelated
kixelated marked this pull request as ready for review September 20, 2026 17:56
@coderabbitai

coderabbitai Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: b369d9a6-e42e-4c20-85ad-6866a7faaaa8

📥 Commits

Reviewing files that changed from the base of the PR and between f31ae98 and 80cccbf.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (51)
  • quest/m1/README.md
  • quest/m1/api-gateways.md
  • quest/m1/api-review-gate.md
  • quest/m2/gateway-embed.md
  • quest/m2/qos/stats/schema.md
  • rs/moq-cli/src/hls.rs
  • rs/moq-cli/src/rtc.rs
  • rs/moq-cli/src/srt.rs
  • rs/moq-hls/Cargo.toml
  • rs/moq-hls/src/error.rs
  • rs/moq-hls/src/export/mod.rs
  • rs/moq-hls/src/export/playlist.rs
  • rs/moq-hls/src/export/rendition.rs
  • rs/moq-hls/src/export/segments.rs
  • rs/moq-hls/src/import.rs
  • rs/moq-hls/src/lib.rs
  • rs/moq-hls/src/server/routes.rs
  • rs/moq-relay/src/stats.rs
  • rs/moq-room/src/claims.rs
  • rs/moq-rtc/Cargo.toml
  • rs/moq-rtc/src/client/whep.rs
  • rs/moq-rtc/src/client/whip.rs
  • rs/moq-rtc/src/codec/av1.rs
  • rs/moq-rtc/src/codec/h264.rs
  • rs/moq-rtc/src/codec/h265.rs
  • rs/moq-rtc/src/codec/mod.rs
  • rs/moq-rtc/src/codec/opus.rs
  • rs/moq-rtc/src/codec/vp8.rs
  • rs/moq-rtc/src/codec/vp9.rs
  • rs/moq-rtc/src/egress.rs
  • rs/moq-rtc/src/error.rs
  • rs/moq-rtc/src/lib.rs
  • rs/moq-rtc/src/server/mod.rs
  • rs/moq-rtc/src/server/whep.rs
  • rs/moq-rtc/src/server/whip.rs
  • rs/moq-rtmp/README.md
  • rs/moq-rtmp/src/error.rs
  • rs/moq-rtmp/src/listen.rs
  • rs/moq-rtmp/src/server.rs
  • rs/moq-srt/Cargo.toml
  • rs/moq-srt/README.md
  • rs/moq-srt/src/dial.rs
  • rs/moq-srt/src/error.rs
  • rs/moq-srt/src/lib.rs
  • rs/moq-srt/src/listen.rs
  • rs/moq-srt/src/server.rs
  • rs/moq-srt/src/ts.rs
  • rs/moq-stats/src/aggregate.rs
  • rs/moq-stats/src/consume.rs
  • rs/moq-stats/src/lib.rs
  • rs/moq-stats/src/produce.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@moq-bot

moq-bot Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor
  1. Breaking Rust API targets main while moq-srt is published at 0.2.11 and same holds for moq-rtc/moq-rtmp/moq-hls/moq-stats/moq-room (rs/moq-srt/Cargo.toml:8, AGENTS.md#development). Retarget PR to dev, set upstream to origin/dev, then rebase.

Verdict: request changes
(Written by Muse Spark)

New%20session%20-%202026-09-20T17%3A57%3A03.458Z
opencode session  |  github run

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