Skip to content

[Rooms][P1] Productionize WebRTC with TURN, quality metrics, and an SFU path #89

Description

@knzeng-e

Goal

Make public listening rooms reliable across mobile networks and scalable beyond a small host-to-listener mesh while preserving the rule that guests receive only the ephemeral stream.

Scope — first production slice

  • Operate a TURN service with short-lived credentials.
  • Deploy signaling close to target users and prefer WebSocket in production.
  • Add ICE candidate pooling and measure join-to-connected, relay usage, packet loss, jitter, RTT, reconnects, and first remote audio.
  • Add explicit reconnect/rejoin states and deterministic host-disconnect behavior.
  • Set conservative listener caps based on host device/network quality.
  • Run cross-network tests: Wi-Fi ↔ mobile, carrier NAT, corporate networks, iOS background/foreground.

Scope — scale path

  • Evaluate an SFU such as LiveKit or mediasoup.
  • Keep one upstream audio flow from the authorized host and relay ephemeral media to listeners.
  • The SFU must not receive durable content keys or source IPFS files.
  • Define host handoff and room continuity before enabling larger rooms.

Acceptance criteria

  • Two strangers can join from hostile NAT environments without manual debugging.
  • Join-to-audio p75 < 1.5 s after room metadata is available.
  • TURN fallback is observable and tested.
  • Room quality degrades visibly and recoverably rather than becoming silent.
  • A documented decision record explains when mesh is used and when SFU becomes mandatory.

Statement Store boundary

Use Statement Store first for room discovery, presence, signed heartbeats, reactions, and provenance. Do not move SDP/ICE off the low-latency signaling path until measured latency and delivery behavior prove it viable.

Metadata

Metadata

Assignees

Labels

dotify-backlogTracked by docs/backlog/backlog.json and Project 5

Projects

Status
Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions