## Problem and outcome Stale ICE and transport callbacks, interrupted media ownership, and optional encoder capabilities could break otherwise recoverable sharing sessions. This maintenance phase corrects those owners across Web, Native and embedded SFU, improves current-state diagnostics, and finishes the affected UI and documentation animation paths. Android, QR invitations and App/Server headline presentation stay on their feature branch. This PR contains the accepted maintenance scope only. ## Release notes **Play together. Your turn!** Approved friends can play together with shared keyboard and mouse controls or optional gamepads. **远程同乐,轮到你啦!** 获准的朋友可以共用键鼠,或使用可选手柄,一起玩本地多人游戏。 ### English This maintenance update improves connection recovery, capture compatibility and troubleshooting for existing Piik rooms. - Keep ICE candidates and gathering completion tied to their current connection. Preserve Viewer route preferences through reconnection and retry newly available Peer opportunities after SFU fallback. - Correct picture and voice ownership during restart, source replacement and connection retirement. Report failed picture dependencies while keeping room voice available. - Separate capture and forwarding statistics and isolate pooled sender attachment failures. - Improve Windows H.264 compatibility with optional encoder properties, retain safe capture failure codes, and keep shared sound volume usable without microphone support. - Improve remote input continuity and mouse responsiveness after idle. - Fix fullscreen handling in some mobile browsers, source-picker refresh, delayed chat confirmations, starred-site startup and local App requests. Refine control motion and reduced-motion behavior. - Restore the mascot's face and shared animation lifecycle in the documentation header. - Include current connection and playback state in diagnostic exports, update Zod to 4.6.6 and simplify shared lifecycle code. Existing 2.x protocols, configuration and default quality settings are preserved. ### 中文 本次维护更新改善现有房间的连接恢复、采集兼容性和故障诊断。 - ICE 候选和收集结束事件跟随当前连接;重连保留观众线路偏好,SFU 兜底后出现新的可用 P2P 机会仍可尝试。 - 修正重启、换源和连接结束时的画面与语音生命周期;语音继续时,画面失败会明确反馈。 - 区分采集与转发统计,隔离编码池中单个输出连接的失败。 - 改善 Windows H.264 可选属性兼容性,保留有效的采集失败原因;没有麦克风能力时也能调整共享声音音量。 - 修复部分移动浏览器全屏、选源刷新、迟到聊天确认、收藏站点启动和本机 App 请求问题,打磨控件动效及减少动态效果行为。 - 修复文档导航 mascot 面部一直隐藏的问题,接回共用动画生命周期。 - 诊断导出补取当前连接与播放状态,升级 Zod 至 4.6.6,精简共用生命周期代码。 沿用现有 2.x 协议、配置和画质默认值。Android、二维码邀请及 App/Server 新增的 HEADLINE 展示留待后续版本。 ## Verification - `npm run check`: type-check, 98 test files / 1,765 tests, production Web build passed. - `npm run check:go-core`: Go formatting, tests, vet, Windows/Linux builds passed; Darwin builds require the native CI runners. - `npm run check:native`: current Windows capture compilation, fixtures and capability probe passed. - `npm run build:website`, TypeScript and repository hygiene checks passed after the documentation-brand fix. - Existing controlled media lifecycle and P2P/SFU voice acceptance covered the retained route/transport changes. Final local browser acceptance covered actual sharing and pause/resume, fullscreen, source refresh, voice/keyboard/settings, 320px to desktop layouts, both themes and all presentation modes. Documentation brand was reproduced broken, then verified on load, replay and reduced motion. - Independent scoped reviews found no integration blocker. ## Impact Patch release v2.4.1. Existing 2.x wire, configuration, authority, capacity and default quality contracts remain intact; no data migration. Source volume no longer depends on microphone availability. Zod 4.6.6 fixes GHSA-mrhx-c7xc-m3w5. The device-specific Windows reports #495 and #452 remain under investigation; this PR improves compatibility and diagnostics without claiming those reports fully resolved. Physical macOS acceptance remains with its native runner/device checks.
6.1 KiB
ADR-0004: Peer-Assisted Media Experiment
- Status: Historical experiment
- Date: 2026-08-19
- Last updated: 2026-08-22
Context
ADR-0001 accepted browser WebRTC P2P for the MVP. Multi-viewer measurements then showed that sending one Host connection per Viewer does not fit the product's small, bounded upload target. The repository therefore explored whether an ordinary browser Viewer could relay the received screen stream to another Viewer.
This ADR records that experiment and its reusable evidence. It does not set the current endpoint capacity, SFU topology, server-assisted transport, fallback sequence, or resource accounting. ADR-0005 owns current routing invariants.
Experiment
The signaling server assigned a deterministic, bounded directed acyclic graph. Each Viewer had at most one active upstream. Join, capacity release, endpoint departure, and current-edge failure were the only reassignment triggers; healthy unaffected branches remained sticky. The experiment intentionally excluded continuous route scoring, periodic rebalance, multiple simultaneous upstreams, and user-selected topology.
Each browser relay rendered the received MediaStream and added its remote
tracks to a separate downstream RTCPeerConnection. This is standard WebRTC,
not packet forwarding or encoded-frame reuse. The browser decodes and normally
re-encodes at each relay hop, and each downstream connection owns separate
packetization, pacing, congestion control, encryption, and upload traffic.
The experiment shared one strictly validated room quality object across current and future senders. Values were bounded to the existing resolution, frame-rate, bitrate, degradation-preference, codec, and screen-audio choices. Sender mutation was serialized and read back from the browser. Requested settings were treated as ceilings and preferences, never as proof of achieved media quality.
Ordinary peer connections remained STUN-only. In the dated experiment, a TURN candidate would have altered the transport of an authorized edge, not the graph semantics or downstream edge count.
Evidence retained
The experiment established these durable facts:
- standard browser track relay incurs a separate downstream sender and cannot be described as zero-copy or shared encode;
- an upstream receive edge is distinct from downstream upload work;
- endpoint capacity must be enforced by the server and revalidated during reconnect, replacement, and stale-signal handling;
- one active Viewer upstream plus an acyclic committed graph is a tractable safety invariant;
- route replacement must be bound to exact sessions, revision, share generation, assignment generation, and connection identity;
- ICE
connectedis not application readiness; the exact candidate child's first newly decoded frame is required before switching; and - loopback tests can prove graph and signaling invariants but cannot establish real-device encoding cost, target-network latency, or production capacity.
Historical capacity-two and capacity-three runs remain measurement evidence. They do not authorize a current release tier or a browser-specific policy.
Experiment gates
A browser relay path is viable only if representative real-device tests record:
- end-to-end and per-hop latency;
- capture, encode, decode, and render frame rates;
- CPU, GPU, encoder count, and
qualityLimitationReason; - endpoint upload, packet loss, retransmission, and recovery;
- topology depth and the failure radius of a relay departure;
- audio continuity and synchronization when screen audio exists; and
- deterministic bounded recovery without stale edges or unauthorized signals.
The path fails closed if it requires a custom RTP injection layer, a new congestion controller, hidden software encoding, unbounded fanout, or a quality claim unsupported by measurements.
Current interpretation
Peer relay is part of the deployed Browser route owned by ADR-0005. This ADR retains only the experiment evidence used to evaluate that route; its historical policy and gates do not independently authorize current behavior.
The current ordinary endpoint rule is one server-authoritative downstream
capacity for every non-server endpoint, default 2 and statically configurable
as 1, 2, or 3; upstream receive is free and role or user agent does not
create an exception. ADR-0005 owns the implemented and deployed Browser route
for direct/SFU publication, subscription, transport, server admission, and
migration overlap. Real heterogeneous-network and resource validation remains
open.
Consequences
Positive:
- the browser path can extend a distributed graph using standard WebRTC;
- exact route generations and media-proven switching are reusable controller invariants; and
- the experiment supplies concrete resource and failure measurements.
Negative:
- every browser relay hop may add decode, encode, latency, and upload cost;
- browser APIs do not guarantee cross-
RTCPeerConnectionshared encoding; and - experimental capacity results cannot substitute for current policy or a real browser and network matrix.
Relationship to other ADRs
- ADR-0001 remains the direct browser P2P baseline.
- ADR-0005 owns current automatic routing and capacity invariants.
- ADR-0007 owns path-quality evidence and representation behavior.
- ADR-0013 and ADR-0014 own accepted encoding reuse; this experiment does not define that behavior.
References
Sources were checked on 2026-08-19: