mirror of
https://github.com/livekit/livekit.git
synced 2026-05-11 14:44:54 +00:00
No JoinResponse during migration (#1277)
* No JoinResponse during migration * Change to take migration into account
This commit is contained in:
@@ -254,6 +254,14 @@ func (p *ParticipantImpl) ProtocolVersion() types.ProtocolVersion {
|
||||
|
||||
func (p *ParticipantImpl) IsReady() bool {
|
||||
state := p.State()
|
||||
|
||||
// when migrating, there is no JoinResponse, state transitions from JOINING -> ACTIVE -> DISCONNECTED
|
||||
// so JOINING is considered ready.
|
||||
if p.params.Migration {
|
||||
return state != livekit.ParticipantInfo_DISCONNECTED
|
||||
}
|
||||
|
||||
// when not migrating, there is a JoinResponse, state transitions from JOINING -> JOINED -> ACTIVE -> DISCONNECTED
|
||||
return state == livekit.ParticipantInfo_JOINED || state == livekit.ParticipantInfo_ACTIVE
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user