Repository navigation
feat(p2p): carry MoQ over reliable data channels - #5595
Conversation
Co-Authored-By: GPT-6 <noreply@openai.com>
Co-Authored-By: GPT-6 <noreply@openai.com>
|
Outcome: the browser data-channel adapter is implemented, documented, and validated. It owns only its reliable ordered channel, preserves caller ownership of RTCPeerConnection, and carries MoQ through qmux with bounded records and event-driven backpressure. Required checks, the full available language interop matrix, seven adapter unit tests, real Chromium SETUP/media transfer, and the nine-case benchmark sweep pass. No unresolved API decisions remain. Keep this PR as a draft for review, then use (Written by GPT-6) |
# Conflicts: # js/justfile
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 25 minutes. View limit details
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. Comment |
|
Merge summary:
No open decisions. Enabling auto-merge. (Written by Opus 5.5) |
Problem
Browser applications cannot supply an RTCDataChannel to the existing MoQ connection API. This adds
@moq/p2p, which carries the existing MoQ streams over a reliable ordered channel using@moq/qmux.Approach
Transport.connect({peer, protocol})creates the client channel;Transport.accept({peer, channel, protocol})adopts the server channel. Both own their channel, while the application retains the peer connection and signaling. The adapter waits for SCTP negotiation, caps records at 16 KiB and the negotiated message size, bounds its receive queue, and applies event-driven send backpressure. It refuses partial reliability, unordered delivery, incompatible protocol labels, malformed messages, and limits below qmux's minimum.A real Chromium test completes MoQ SETUP and transfers a 256 KiB frame through the public connection API. Unit tests cover both stream-ID roles, record limits including unbounded SCTP negotiation, close information, listener cleanup, backpressure, malformed input, and cancellation before channel opening. CI runs the browser test; nightly runs a benchmark swept across 1/8/64 streams and 1/16/256 KiB payloads.
Public API and wire impact
@moq/p2pexports:Transport,ConnectProps, andAcceptProps. Its WebTransport-shaped handle supports streams and reports a zero datagram limit.webrtc; the web demo displays that label.Framespayloads, one per binary message, without the byte-stream Record Size field. Existing published transport bindings are unchanged.Alternatives
A separate dialer would duplicate MoQ negotiation; callers instead supply this transport to the existing connection factories. Owning the peer connection would prevent an application from sharing its connection with other channels, so ownership remains with the caller as agreed.
Validation
just checkpassed, including affected JS packages, package build/publint, drafts, CI configuration tests, and selected Rust checks.just test interop --allpassed the full available language matrix and close/tail checks.just test p2ppassed in Chromium, including cleanup. One overlapping run passed its media assertions but exceeded Bun's default five-second browser teardown hook while interop builds were active; an isolated final run passed without changing timeouts.just js p2p-benchpassed all nine stream/payload combinations. These are coverage measurements on a shared host, not an optimization comparison.just drafts check,quest check, andgit diff --checkpassed.Follow-ups
Existing P2P signaling and native WebRTC quests provide the next integration layers. No additional public API decisions remain for this adapter. The completed transport quest and its references are removed.
(Written by GPT-6)