Update dependencies to generic versions (#1259)

This commit is contained in:
David Zhao
2022-12-26 22:29:13 -08:00
committed by GitHub
parent 51aee8f3cb
commit 988858a98a
7 changed files with 34 additions and 39 deletions
+8 -9
View File
@@ -47,18 +47,17 @@ func (p *ParticipantImpl) SendParticipantUpdate(participantsToUpdate []*livekit.
validUpdates := make([]*livekit.ParticipantInfo, 0, len(participantsToUpdate))
for _, pi := range participantsToUpdate {
isValid := true
if val, ok := p.updateCache.Get(pi.Sid); ok {
if lastVersion, ok := val.(uint32); ok {
// this is a message delivered out of order, a more recent version of the message had already been
// sent.
if pi.Version < lastVersion {
p.params.Logger.Debugw("skipping outdated participant update", "version", pi.Version, "lastVersion", lastVersion)
isValid = false
}
pID := livekit.ParticipantID(pi.Sid)
if lastVersion, ok := p.updateCache.Get(pID); ok {
// this is a message delivered out of order, a more recent version of the message had already been
// sent.
if pi.Version < lastVersion {
p.params.Logger.Debugw("skipping outdated participant update", "version", pi.Version, "lastVersion", lastVersion)
isValid = false
}
}
if isValid {
p.updateCache.Add(pi.Sid, pi.Version)
p.updateCache.Add(pID, pi.Version)
validUpdates = append(validUpdates, pi)
}
}