LiveKitRoom: report ParticipantJoined only when the participant can receive data #125

Closed
opened 2026-11-11 20:45:29 +00:00 by charles · 1 comment
Owner

From the review of PR #121 (Voice 13), minor finding on Review Focus 2 ("the advertisement goes out again for each newly joined participant").

LiveKitRoom reports RoomEvent::ParticipantJoined on the SDK's ParticipantConnected. The SDK's documentation says that event fires before the participant can receive data messages, and names RoomEvent::ParticipantActive as the one to answer with data. fluxer-core advertises on VoiceEvent::ParticipantJoined, so an advertisement can go to a participant the server does not yet deliver data to, and publish_data reports no error.

What is known (commit 2a9d563):

  • Against livekit-server v1.12.0 the case does not occur for clients that publish a track when they join (ours do): the server announces such a participant once it is active. The interop test data_sent_on_participant_joined_reaches_the_newcomer passes 10 of 10 runs.
  • A client that joins without publishing may be announced while still connecting. Not reproduced.
  • The protocol recovers either way: every client answers the first advertisement of an identity with its own.

To do: report ParticipantJoined only once the participant is active, or add an event for it. Not a one-line change: the SDK can report TrackPublished for a participant before ParticipantActive, and the participants listed in the SDK's Connected event may not be active yet, so the order of ParticipantJoined and TrackPublished that the session relies on has to be kept. Touches crates/fluxer-voice/src/rtc.rs, possibly room.rs and session.rs.

From the review of PR #121 (Voice 13), minor finding on Review Focus 2 ("the advertisement goes out again for each newly joined participant"). `LiveKitRoom` reports `RoomEvent::ParticipantJoined` on the SDK's `ParticipantConnected`. The SDK's documentation says that event fires before the participant can receive data messages, and names `RoomEvent::ParticipantActive` as the one to answer with data. `fluxer-core` advertises on `VoiceEvent::ParticipantJoined`, so an advertisement can go to a participant the server does not yet deliver data to, and `publish_data` reports no error. What is known (commit 2a9d563): - Against livekit-server v1.12.0 the case does not occur for clients that publish a track when they join (ours do): the server announces such a participant once it is active. The interop test `data_sent_on_participant_joined_reaches_the_newcomer` passes 10 of 10 runs. - A client that joins without publishing may be announced while still connecting. Not reproduced. - The protocol recovers either way: every client answers the first advertisement of an identity with its own. To do: report `ParticipantJoined` only once the participant is active, or add an event for it. Not a one-line change: the SDK can report `TrackPublished` for a participant before `ParticipantActive`, and the participants listed in the SDK's `Connected` event may not be active yet, so the order of `ParticipantJoined` and `TrackPublished` that the session relies on has to be kept. Touches `crates/fluxer-voice/src/rtc.rs`, possibly `room.rs` and `session.rs`.
charles added this to the Voice milestone 2026-11-11 20:45:29 +00:00
Author
Owner

Done on textchat (c24495a): fluxer-voice/src/rtc.rs:2098-2107: joins are gated on ParticipantState::Active, and ParticipantActive releases the held ones

Closed during the 2026-11-14 issue triage.

🤖 Generated with Claude Code

Done on `textchat` (c24495a): `fluxer-voice/src/rtc.rs:2098-2107`: joins are gated on `ParticipantState::Active`, and `ParticipantActive` releases the held ones Closed during the 2026-11-14 issue triage. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/fluxer-native#125
No description provided.