From 20bddfea1ec94f29de6d4ffd03217851fbd8b68b Mon Sep 17 00:00:00 2001 From: Raja Subramanian Date: Fri, 14 Mar 2025 16:09:22 +0530 Subject: [PATCH] Clean up published track on participant removal. (#3527) Clean up the tracks in the synchronous path and remove track from track manager. This is not strictly required in a single node case. But, multi-node needs this. So, doing this here for consistency. --- pkg/rtc/room.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/rtc/room.go b/pkg/rtc/room.go index 7c89092f5..76d9515da 100644 --- a/pkg/rtc/room.go +++ b/pkg/rtc/room.go @@ -710,6 +710,7 @@ func (r *Room) RemoveParticipant(identity livekit.ParticipantIdentity, pID livek // remove all published tracks for _, t := range p.GetPublishedTracks() { + p.RemovePublishedTrack(t, false, true) r.trackManager.RemoveTrack(t) }