Revert "fix: ensure num_participants is accurate in webhook events (#4265) (#…" (#4448)

This reverts commit cdb0769c38.
This commit is contained in:
cnderrauber
2026-04-13 22:21:22 +08:00
committed by GitHub
parent cdb0769c38
commit ce1bf47b5c
2 changed files with 7 additions and 12 deletions
+3 -4
View File
@@ -569,8 +569,7 @@ func (r *RoomManager) StartSession(
persistRoomForParticipantCount(room.ToProto())
clientMeta := &livekit.AnalyticsClientMeta{Region: r.currentNode.Region(), Node: string(r.currentNode.NodeID())}
// Use a consistent room proto so num_participants reflects the newly joined participant
r.telemetry.ParticipantJoined(ctx, room.ToProtoConsistent(), participant.ToProto(), pi.Client, clientMeta, true, participant.TelemetryGuard())
r.telemetry.ParticipantJoined(ctx, protoRoom, participant.ToProto(), pi.Client, clientMeta, true, participant.TelemetryGuard())
participant.AddOnClose(types.ParticipantCloseKeyNormal, func(p types.LocalParticipant) {
participantServerClosers.Close()
@@ -578,8 +577,8 @@ func (r *RoomManager) StartSession(
pLogger.Errorw("could not delete participant", err)
}
// use consistent proto so num_participants is accurate for webhook
proto := room.ToProtoConsistent()
// update room store with new numParticipants
proto := room.ToProto()
persistRoomForParticipantCount(proto)
r.telemetry.ParticipantLeft(ctx, proto, p.ToProto(), true, participant.TelemetryGuard())
})