report a reason on room-ended telemetry (#4815)

* report a reason on room-ended telemetry

Room.Close already took a ParticipantCloseReason, but OnClose was func()
with no arguments, so the reason was structurally dropped before it could
reach RoomEnded.

Add types.RoomCloseReason and carry it through Close -> OnClose -> RoomEnded,
where it lands on both the analytics event and the room_finished webhook.

Room.Close now takes the room reason and derives the participant reason from
it, so the two can never disagree. ToParticipantCloseReason maps each reason
to exactly what its call site passed before, so no participant-facing
behaviour changes; a table test pins that mapping.

* fix(test): update webhook test for RoomCloseReason

test/ was outside the packages checked before pushing, so this Close call
site was missed. Also assert the reason reaches the room_finished webhook,
which the unit test cannot cover since it runs with a nil notifier.
This commit is contained in:
Paul Wells
2026-08-28 23:41:59 -07:00
committed by GitHub
parent a1be640b12
commit 54496c765d
11 changed files with 143 additions and 45 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ require (
github.com/jxskiss/base62 v1.1.0
github.com/livekit/mageutil v0.0.0-20250511045019-0f1ff63f7731
github.com/livekit/mediatransportutil v0.0.0-20260821083140-f234b534b095
github.com/livekit/protocol v1.50.5-0.20260828115123-c6d0e234b41d
github.com/livekit/protocol v1.50.5-0.20260829061921-678f2494b3a7
github.com/livekit/psrpc v0.7.5
github.com/mackerelio/go-osstat v0.2.8
github.com/magefile/mage v1.17.2