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
+4 -8
View File
@@ -323,14 +323,6 @@ func (r *Room) ToProto() *livekit.Room {
return r.protoProxy.Get()
}
// ToProtoConsistent returns a room proto with participant counts computed
// directly from the current participants map, bypassing the batched proto
// proxy. Use this when an accurate num_participants is required immediately,
// e.g. for webhook or telemetry events.
func (r *Room) ToProtoConsistent() *livekit.Room {
return r.updateProto()
}
func (r *Room) Name() livekit.RoomName {
return livekit.RoomName(r.protoRoom.Name)
}
@@ -1411,6 +1403,10 @@ func (r *Room) RemoveParticipant(
delete(r.participantRequestSources, identity)
delete(r.hasPublished, identity)
delete(r.agentParticpants, identity)
if !p.Hidden() {
r.protoRoom.NumParticipants--
}
immediateChange := false
if p.IsRecorder() {
activeRecording := false