Repository navigation
fix: republish a peer's tracks into each new occupancy (LUM-708) - #19
Merged
FrekiManagarm merged 1 commit intoNov 7, 2026
Merged
Conversation
Telemetry keys tracks by occupancy, but TrackPublished only fired on str0m's MediaAdded, once per connection. After a room switch, a leave then join, or an offer that beat the first join, the new occupancy had no track: no TrackSample and no TrackCodec were ever written for it. - on join, republish every m-line the connection already publishes, right after PeerJoined (tracks.peer_id references peers.id) - Telemetry::publish_track is the single, idempotent way to publish: a TrackAdded still queued when the join runs does not publish twice - the minting track_id is now test-only, so no orphan id can be made - first tests of the transport pump: samples follow the track into its new occupancy, none without a published track, no duplicate publish
FrekiManagarm
force-pushed
the
feat/lum-708-republish-tracks
branch
from
November 3, 2026 23:48
a80c728 to
2ded39e
Compare
FrekiManagarm
force-pushed
the
feat/lum-553-stats-sampling
branch
from
November 3, 2026 23:48
5efce3b to
362ff36
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.
Summary
Fixes LUM-708. Telemetry keys tracks by occupancy (one per
join), butTrackPublishedonly fired on str0m'sMediaAdded, once per connection. So in three cases the new occupancy ended up with no track, and noTrackSampleorTrackCodecwas ever written for it:leavefollowed by ajoin;join. The pump dropped theTrackAddedfor lack of an occupancy.Changes
join(signaling/dispatch.rs): every m-line the connection already publishes (rx_kind) is republished into the fresh occupancy, right afterPeerJoined, becausetracks.peer_idreferencespeers.id.Telemetry::publish_trackis now the single way to publish a track, used by both the transport pump and the join. It is idempotent: aTrackAddedstill queued when the join runs does not publish twice. Without this,track_publishedwould be duplicated in the events log, althoughtracksitself is protected byon conflict do nothing.Telemetry::track_id, which mints an id without recording anything, is now#[cfg(test)]. It was the API that could produce orphan track ids.impl From<MediaKind> for TrackKindreplaces the inline mapping.Test plan
dispatchtests:PeerJoined, and room A's tracks are released;signaling::session):TrackAddedafter the join does not publish twice.publish_tracknon-idempotent fails both idempotence tests.cargo test(166 passed),cargo clippy --all-targets -- -D warnings,cargo fmt --check