Repository navigation
huddle: media state and leave on the /rtc door - #253
Merged
Merged
Conversation
naliyi
pushed a commit
that referenced
this pull request
Nov 9, 2026
added 7 commits
November 10, 2026 22:02
The zap ranking cache refreshes in the background, so its totals can change with no new commit; the stats publisher now also rebuilds when they differ from the last ones it published.
nmilat closes events and done together on EOSE; selecting on done could return before the kind 0 still buffered in events was read.
A browser stopping its camera only detaches the track, so to everyone
else the picture just stops -- indistinguishable from packet loss. A
hang-up and a dropped connection looked the same too. Clients had to
guess from silence, and showed "Reconnecting" for both.
Clients now say what they mean over signalling, and the relay fans it
out at once:
- client -> {"type":"media","kind":"mic|camera|screen","state":"live|off"}
is relayed to the room with the publisher's pubkey and a per-session
seq, and each peer's media is listed on "joined" for late joiners.
- client -> {"type":"leave"} before hanging up; "left" now carries
reason leave, evicted or dropped.
- "joined" lists features so a client can tell this relay from an
older one. Everything is additive; no protocol version bump.
This also fixes WebRTC peers never receiving room control at all: the
SFU built its RTP sink without OnControl, so other peers' joined/left
were discarded for browsers, and membership eviction never closed an
RTC session. Control is queued without blocking the room lock and
written behind the peer's own "joined".
Covered by unit tests in huddle/sfu and four new docker scenarios
(StoppedCameraIsAnnounced, MicStateRoundTrip, LeaveVersusDrop,
LateJoinerSeesMediaState).
2 tasks done
naliyi
force-pushed
the
feat/huddle-media-state
branch
from
November 10, 2026 22:55
0ba6931 to
b8dfcef
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #252
Summary
live/offand sayleave; the relay fans both out, lists each peer's media onjoined, andleftcarriesreason(leave,evicted,dropped).joined.featureslets clients detect support; no protocol bump.Test plan
go test ./huddle/...TestHuddleIntegrationagainst the compose relay, incl. StoppedCameraIsAnnounced, MicStateRoundTrip, LeaveVersusDrop, LateJoinerSeesMediaStateTestHuddleStressnot run (needs localhost:21540, unreachable from the dev container)