Describe the bug
To start, I am not quite sure this is a bug per se, but there is appears to be at a minimum some inconsistencies between webhook events, and events received through the Livekit SDK
In short, I am looking at migrating some parts of my system from relying on events received through the Go Livekit SDK (participant joined, participant left, namely) over to using webhooks. This seems to be reliable in majority of cases, but with some outliers.
-
I've noticed that in the case of participant_joined events, the webhook is notably faster than the same event being received by the application using the Go SDK. In some cases up to 2 seconds faster. This in and of itself is not necessarily a problem, but indicates to me that the conditions that lead to sending the the event through the webhook and sending the same event over the room connection / SDK differ. This could play into the second issue.
-
There's a discrepancy between events. Notably, I will receive participant_joined events through the SDK but not from the webhook. Investigation of the logs seems to indicate that participant_connection_aborted hook does fire. Livekit logs show something like removing participant without connection. This seems to tell me that
-
The SDK indicates a participant has joined the room.
-
The webhook tells me a participant FAILED to join the room.
Which is correct? My system has been operating to this point purely on the SDK, which makes me feel that it is more reliable. But in either case the semantics between the two events are clearly different. This could be a bug, or just a documentation issue or SDK API problem, not sure.
Server
- Version: 1.9.4
- Environment: EKS
Client
To Reproduce
- Go app joins a room
- Other client joins the room
- Go app sees
participant_connected over the SDK callback onParticipantConnected
- Webhook received for
participant_connected (often before the SDK callback) OR not received at all
Expected behavior
Webhooks and SDK events match 1:1 in a timely manner
Describe the bug
To start, I am not quite sure this is a bug per se, but there is appears to be at a minimum some inconsistencies between webhook events, and events received through the Livekit SDK
In short, I am looking at migrating some parts of my system from relying on events received through the Go Livekit SDK (participant joined, participant left, namely) over to using webhooks. This seems to be reliable in majority of cases, but with some outliers.
I've noticed that in the case of
participant_joinedevents, the webhook is notably faster than the same event being received by the application using the Go SDK. In some cases up to 2 seconds faster. This in and of itself is not necessarily a problem, but indicates to me that the conditions that lead to sending the the event through the webhook and sending the same event over the room connection / SDK differ. This could play into the second issue.There's a discrepancy between events. Notably, I will receive
participant_joinedevents through the SDK but not from the webhook. Investigation of the logs seems to indicate thatparticipant_connection_abortedhook does fire. Livekit logs show something likeremoving participant without connection. This seems to tell me thatThe SDK indicates a participant has joined the room.
The webhook tells me a participant FAILED to join the room.
Which is correct? My system has been operating to this point purely on the SDK, which makes me feel that it is more reliable. But in either case the semantics between the two events are clearly different. This could be a bug, or just a documentation issue or SDK API problem, not sure.
Server
Client
To Reproduce
participant_connectedover the SDK callbackonParticipantConnectedparticipant_connected(often before the SDK callback) OR not received at allExpected behavior
Webhooks and SDK events match 1:1 in a timely manner