Skip to content

deps/moq-net-0.2 - #44

Closed
ra0x3 wants to merge 9 commits into
n0-computer:mainfrom
ra0x3:main
Closed

ra0x3 wants to merge 9 commits into
n0-computer:mainfrom
ra0x3:main

Conversation

@ra0x3

@ra0x3 ra0x3 commented Aug 27, 2026

Copy link
Copy Markdown

Hi 👋🏼 ,

  • I was recommended iroh from some P2P streaming-related work I'm considering (and just running some tests on).
  • I see it's been a few weeks since the project was updated, so I just am pushing some of these things for my own use locally, and thought iroh-live might be able to use it as a head start to get the project back up to speed :)
  • This is primarily just a deps change PR - no real code changes done outside the scope of that
  • Happy to make any adjustments (or abandon if it's unnecessary)

Summary

Updates iroh and the MoQ stack to current crates.io releases.

Crate From To
moq-lite (moq-net) 0.1.11 0.2.14
moq-mux 0.5.5 0.9.9
hang 0.19.1 0.20.6
moq-native 0.17.1 0.19.13
moq-relay 0.12.2 0.14.12
web-transport-iroh 0.6.0 0.7.0
iroh 1.0.0 1.1.0
cpal 0.18.1 0.18.2
@moq/watch 0.2.8 0.5.2
@moq/publish 0.2.4 0.4.5
  • The MoQ crates are locked to each other through moq-net 0.2, so they move in one commit.
  • iroh 1.1 is semver compatible and needs no source changes.
  • iroh-gossip, iroh-tickets and iroh-smol-kv accept iroh ^1 and are unchanged.
  • Each commit compiles on its own.

API changes

  • Model types moved into role modules. Broadcast/BroadcastProducer/BroadcastConsumer became broadcast::{Info, Producer, Consumer}, same for track. Aliased imports keep call sites unchanged.
  • connect()/accept() return (Session, Driver). The driver has to be polled for the session lifetime, so iroh-moq spawns it with the session.
  • origin::Producer::publish_broadcast is gone. The origin mints producers via create_broadcast(path, Route) instead of adopting an existing consumer. iroh-moq creates the announced broadcast and forwards into it; iroh-live-relay's pull path uses the same helper.
    • The broadcast has to be announced. A peer's subscriber only builds its local source when an announcement arrives, so serving through the origin's dynamic handler alone compiles but is unreachable across a session.
  • moq_mux::import::Stream is gone, split into ContainerStream (fmp4) and TrackStream (avc3). The CLI importer follows that split.
  • hang 0.20 catalog changes:
    • VideoConfig::display_ratio_* renamed to display_aspect_*, jitter dropped.
    • Its Track type no longer carries a name or derives serde, so IrohLiveExt's chat entry uses a local DTO.
    • The serialized JSON is unchanged. The browser client validates that section of the catalog whether or not it subscribes to chat.
  • Subscribing to a track is async now. Propagates to RemoteBroadcast::{video, video_with, video_rendition, raw_video_track, raw_audio_track, chat}. MoqSession::publish returns Result, since announcing can fail.

Maintainer notes

moq-relay 0.14.12 does not build as published

  • It declares http-cache-reqwest = "1.0.0-alpha.6" with default-features = false, features = ["manager-moka", "url-standard"].
  • In alpha.8 reqwest-middleware became an optional dependency, so that feature set no longer enables it:
error: either feature `reqwest-middleware` or `middlewest` must be enabled
error[E0432]: unresolved import `reqwest_middleware`
  • Pinned to alpha.7 in Cargo.lock here.
  • A future cargo update will select alpha.8 again. Fixing it upstream needs an upper bound or the feature adding.

Publisher disconnect regression

Caught by publisher_drop_closes_subscriber.

  • moq-net 0.2 expects a producer to be finished explicitly, and the dynamic handler now counts as a live handle.
  • Dropping LocalBroadcast stopped closing the broadcast, so subscribers never saw the disconnect.
  • Fixed with a refcounted guard on the existing task handle.
  • LocalBroadcast is Clone, so a plain Drop impl would close the broadcast as soon as the first clone went away.

Verification

CI green on Linux, macOS, Playwright browser E2E, and the aarch64 zigbuild.

Locally on macOS 26 with Rust 1.98:

  • cargo check across default, --all-features, --no-default-features
  • clippy --all-targets --all-features -- -D warnings
  • fmt --check
  • 346 tests
  • 3 Playwright specs. @moq/hang 0.4 parses hang 0.20's catalog, and browser to relay negotiates moq-lite-05

Other commits

  • 9388026 fix: satisfy newer-toolchain lints: moq-relay 0.14 puts the floor at Rust 1.95, and that clippy flags chunks_exact with a constant size. Pre-existing sites, but -D warnings fails without them.
  • ca2cf17 build: commit the relay web lockfile: CI runs npm ci, which needs a lockfile. It only worked because build.rs ran npm install first and created one.
  • 752ad80 ci: cancel superseded runs: per workflow, per ref concurrency group. Release serialises instead of cancelling, since it replaces assets on the rolling release and a run killed mid upload leaves the binaries and SHA256SUMS out of sync.
  • 503314b docs: drop the stale patch.crates-io instruction: that section was removed from Cargo.toml in April.
  • 47b0cc7 docs: correct the ALPN version in the docs: four references still named moq-lite-03.
  • e12851b ci: correct the dioxus exclusion comments: the comments said moq-media-dioxus is only checked weekly, but --workspace overrides default-members and every run already compiles it. Comment only. To fix the behaviour instead:
    • drop the weekly job as redundant, or
    • add --exclude moq-media-dioxus to the main jobs so the claim holds and pushes get faster.

The ALPN stays on moq-lite-04. moq-net 0.2 prefers moq-lite-05 and still advertises 04, so this works as is. Moving to 05 breaks direct iroh peers and belongs in its own PR.

ra0x3 added 9 commits August 26, 2026 14:28
Updates iroh to 1.1, cpal to 0.18.2, and the MoQ stack to moq-net 0.2 with the API adaptations that requires.
Replaces chunks_exact with as_chunks in the sites clippy now flags, surfaced by the toolchain floor the MoQ update raises.
Moves @moq/watch to 0.5.2 and @moq/publish to 0.4.5, which follow the Rust stack from @moq/lite onto @moq/net.
CI runs npm ci, which needs a lockfile; until now it only worked because build.rs ran npm install first and created one.
That section was removed from Cargo.toml in April and the workspace has been entirely on crates.io dependencies since.
All four references still named moq-lite-03, one wire version behind the code.
Both comments claimed moq-media-dioxus is only checked weekly, but --workspace overrides default-members and every CI run already compiles it.
Adds a per-workflow, per-ref concurrency group so a new push cancels the CI and aarch64 runs it supersedes, while Release serialises instead of cancelling to avoid a half-replaced asset set.
Carries the subscriber's own preferences and resolved track info through the forwarding handshake, rejects unservable track requests instead of accepting them, and stops the new code leaking task handles and swallowing errors.
@ra0x3
ra0x3 marked this pull request as draft August 27, 2026 00:33
@Frando

Frando commented Sep 9, 2026

Copy link
Copy Markdown
Member

Hi, I just merged #45, which includes these updates together with many more. Feel free to submit further PRs as you play with things!

@Frando Frando closed this Sep 9, 2026
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.

2 participants