Clear participant version cache on disconnect (#4234)

* debug participant update

* more debug

* context logger

* log participant info

* more logging

* clear participant cache on disconnect

* clean up

* clean up
This commit is contained in:
Raja Subramanian
2026-01-13 09:36:09 +05:30
committed by GitHub
parent 18db4ec146
commit c40150085a
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -282,7 +282,7 @@ type ParticipantImpl struct {
// queued participant updates before join response is sent
// guarded by updateLock
queuedUpdates []*livekit.ParticipantInfo
// cache of recently sent updates, to ensuring ordering by version
// cache of recently sent updates, to ensure ordering by version
// guarded by updateLock
updateCache *lru.Cache[livekit.ParticipantID, participantUpdateInfo]
updateLock utils.Mutex
+4
View File
@@ -118,6 +118,10 @@ func (p *ParticipantImpl) SendParticipantUpdate(participantsToUpdate []*livekit.
})
validUpdates = append(validUpdates, pi)
}
if pi.State == livekit.ParticipantInfo_DISCONNECTED {
p.updateCache.Remove(pID)
}
}
p.updateLock.Unlock()