From 51bbe8c52bceef7211c1cfa8ec338d48dfb9efdb Mon Sep 17 00:00:00 2001 From: cnderrauber Date: Mon, 14 Jul 2025 10:59:59 +0800 Subject: [PATCH] Set participant active when peerconnection connected (#3790) Don't wait datachannel ready (sctp handshake) --- pkg/rtc/participant.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkg/rtc/participant.go b/pkg/rtc/participant.go index a68e1e4a8..bfc1aa849 100644 --- a/pkg/rtc/participant.go +++ b/pkg/rtc/participant.go @@ -1947,10 +1947,6 @@ func (p *ParticipantImpl) updateState(state livekit.ParticipantInfo_State) { } } - if state == livekit.ParticipantInfo_ACTIVE { - p.replayJoiningReliableMessages() - } - p.params.Logger.Debugw("updating participant state", "state", state.String()) p.dirty.Store(true) @@ -2351,15 +2347,17 @@ func (p *ParticipantImpl) onPrimaryTransportInitialConnected() { // else, wait for all tracks to be published and publisher peer connection established p.SetMigrateState(types.MigrateStateComplete) } -} -func (p *ParticipantImpl) onPrimaryTransportFullyEstablished() { if !p.sessionStartRecorded.Swap(true) { prometheus.RecordSessionStartTime(int(p.ProtocolVersion()), time.Since(p.params.SessionStartTime)) } p.updateState(livekit.ParticipantInfo_ACTIVE) } +func (p *ParticipantImpl) onPrimaryTransportFullyEstablished() { + p.replayJoiningReliableMessages() +} + func (p *ParticipantImpl) clearDisconnectTimer() { p.lock.Lock() if p.disconnectTimer != nil {