From d2bae34d5360a060ad57cedd4c1d6d029600e0d0 Mon Sep 17 00:00:00 2001 From: Raja Subramanian Date: Tue, 3 Feb 2026 15:34:16 +0530 Subject: [PATCH] refresh telemetry guard on participant move (#4280) --- pkg/rtc/participant.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/rtc/participant.go b/pkg/rtc/participant.go index b572275c..6691c22c 100644 --- a/pkg/rtc/participant.go +++ b/pkg/rtc/participant.go @@ -919,6 +919,9 @@ func (p *ParticipantImpl) ToProto() *livekit.ParticipantInfo { } func (p *ParticipantImpl) TelemetryGuard() *telemetry.ReferenceGuard { + p.lock.RLock() + defer p.lock.RUnlock() + return p.telemetryGuard } @@ -4015,6 +4018,10 @@ func (p *ParticipantImpl) MoveToRoom(params types.MoveToRoomParams) { p.params.Logger.Infow("move participant to new room", "newRoomName", params.RoomName, "newID", params.ParticipantID) + p.lock.Lock() + p.telemetryGuard = &telemetry.ReferenceGuard{} + p.lock.Unlock() + p.params.LoggerResolver.Reset() p.params.ReporterResolver.Reset() p.setListener(params.Listener)