From 13b1b4808fdfb6838a6c38462f27b5c1463258fd Mon Sep 17 00:00:00 2001 From: David Zhao Date: Tue, 15 Aug 2023 17:30:26 -0700 Subject: [PATCH] Fix race condition causing new participants to have stale room metadata (#1969) If room metadata is changed in between when a participant is joining and when they've became active, that participant will not have the latest room metadata. --- pkg/rtc/room.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/rtc/room.go b/pkg/rtc/room.go index f153d27e..7d8a12a0 100644 --- a/pkg/rtc/room.go +++ b/pkg/rtc/room.go @@ -740,9 +740,7 @@ func (r *Room) sendRoomUpdate() { roomInfo := r.ToProto() // Send update to participants for _, p := range r.GetParticipants() { - // new participants receive the update as part of JoinResponse - // skip inactive participants - if p.State() != livekit.ParticipantInfo_ACTIVE { + if !p.IsReady() { continue }