Skip to content

ParticipantConnectedEvent not emitted when single host rejoins room without tracks #982

@pervanluka

Description

@pervanluka

Description

When a room has a single host who disconnects and then rejoins without any tracks published (camera OFF, microphone OFF, share OFF), the ParticipantConnectedEvent is not emitted to other participants (viewers). This only occurs when there is one host in the room.

Expected Behavior:

  • ParticipantConnectedEvent should fire whenever a remote participant joins the room, regardless
    of whether they have tracks published.

Actual Behavior:

  • ParticipantConnectedEvent is not emitted when a single host rejoins without camera/microphone
  • The only event received is RoomMetadataChangedEvent
  • Even after RoomMetadataChangedEvent, checking room.remoteParticipants does not include the
    host
  • Once the host enables camera or microphone, ParticipantConnectedEvent finally fires

Steps to Reproduce

  1. Create a room with one host and one viewer
  2. Host joins with camera and microphone enabled → ParticipantConnectedEvent fires ✅
  3. Host disconnects → ParticipantDisconnectedEvent fires ✅
  4. Host rejoins the room with camera OFF and microphone OFF
  5. Viewer receives RoomMetadataChangedEvent but NO ParticipantConnectedEvent ❌
  6. Host enables camera → NOW ParticipantConnectedEvent fires

Logs

// Host is in room (before leaving)
RoomMetadataChangedEvent
// remoteParticipants check: hosts: 1, total: 2

// Host disconnects
ParticipantDisconnectedEvent

// Host rejoins WITHOUT camera/mic - NO ParticipantConnectedEvent
RoomMetadataChangedEvent
// remoteParticipants check: hosts: 0, total: 1 ← host not in list!

// Host enables camera - NOW event fires
ParticipantConnectedEvent

Environment

  • SDK: livekit_client (Flutter) - v2.6.2
  • Platform: Android (also likely affects iOS)
  • Flutter version: 3.38.7

Impact

Viewers cannot detect when a host joins the room if the host has camera and microphone disabled.
This breaks UX for scenarios where hosts may want to join silently before enabling their media.

Workaround Attempted

We tried checking room.remoteParticipants on RoomMetadataChangedEvent, but the participant is
not in the list at that point due to a timing gap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions