every.channel/evolution/proposals/ECP-0057-direct-publish-session-reconnect.md
2026-02-15 16:17:27 -05:00

34 lines
1.1 KiB
Markdown

# ECP-0057: Direct-Publish Session Reconnect + Busy Listing Semantics
Status: Draft
## Problem
`ec-node direct-publish` (direct WebRTC + CMAF over DataChannel) is currently a 1:1 stream.
Two concrete issues hurt reliability:
1. Directory entries can remain visible while a session is already connected, causing new viewers to
click "Watch" and silently fail.
2. If a viewer disconnects (reload, laptop sleeps, etc), the publisher has no way to accept a new
viewer without restarting the process.
## Proposal
- Make `direct-publish` a session loop:
- Create a fresh PeerConnection offer.
- Announce it to the directory.
- Wait for one answer.
- Stream until send fails / ffmpeg ends.
- Restart with a new offer.
- Once a session is connected, stop refreshing announcements and quickly expire the directory entry
(so the directory reflects joinable streams only).
This preserves the current 1:1 nature while making reconnection and "send a link" behavior much
more robust.
## Non-Goals (For Now)
- True 1:many fanout / relaying for direct streams.
- Multi-viewer, simultaneous subscriptions to the same publisher connection.