mirror of
https://github.com/livekit/livekit.git
synced 2026-10-23 10:52:46 +00:00
Ensure older session does not clobeer newer session. (#1974)
This commit is contained in:
1 parent
129b1df8e6
commit
1a32439d7e
2 files changed
+10
-2
No files matched your search
@@ -58,8 +58,7 @@ func (p *ParticipantImpl) SendJoinResponse(joinResponse *livekit.JoinResponse) e
|
||||
return err
|
||||
}
|
||||
|
||||
// update state after to sending message, so that no participant updates could slip through before JoinResponse is
|
||||
// sent
|
||||
// update state after sending message, so that no participant updates could slip through before JoinResponse is sent
|
||||
p.updateLock.Lock()
|
||||
if p.State() == livekit.ParticipantInfo_JOINING {
|
||||
p.updateState(livekit.ParticipantInfo_JOINED)
|
||||
|
||||
@@ -1069,6 +1069,15 @@ func (r *Room) pushAndDequeueUpdates(pi *livekit.ParticipantInfo, isImmediate bo
|
||||
return nil
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ep := r.GetParticipant(identity)
|
||||
if ep != nil {
|
||||
epi := ep.ToProto()
|
||||
if epi.JoinedAt > pi.JoinedAt {
|
||||
// older session update, newer session has already become active, so nothing to do
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if shouldSend {
|
||||
|
||||
Reference in new issue
Block a user