No JoinResponse during migration (#1277)

* No JoinResponse during migration

* Change  to take migration into account
This commit is contained in:
Raja Subramanian
2022-12-31 11:43:48 +05:30
committed by GitHub
parent a87574da31
commit 9b8311ffcb
+8
View File
@@ -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
}