Hello LiveKit team, the webhook from LiveKit cloud...
# cloud
p
Hello LiveKit team, the webhook from LiveKit cloud is sent multiple times for the same room with the same payload. Is there a reason for that? Is there a way to avoid having the same webhook payload received the 2nd time?
r
Webhooks we be retransmitted if we do not receive a 200OK your webserver.
p
Our server does send a 200 ok but it might take more than 10 secs to send the response. Is there like a timeout based retry too on LiveKit side?
r
yes, there is a timeout but I am not sure what it is. As is true with nearly all webhook implementations you should not block the webhook sender. Queue the event and return 200OK as fast as possible and process them asynchronously.
p
Got it - can I know the timeout too just for my understanding? I will check on what we can do to send the 200OK ASAP from our end. Thanks for the help
r
I am not sure what it is currently set to and it is subject to change over time. So the webhook receiver should store the event and return as fast as possible.
👍 1
p
I am seeing webhooks being sent to us within 3 millisecs apart. Sharing the SS on DM. But below are Ids: Egress Id
Copy code
EG_dfCBYUcwAoye
Room Id:
Copy code
RM_q4KqDJ82ob6i
Any idea on how we can avoid these webhooks being sent at the same time pls?
g
It depends what you are doing with the webhook receiver, if you're storing some event in a DB or doing some processing you could do some deduping/use ACID guarantees/ use unique constraint on columns to make sure you don't repeat processes. Essentially, there's some things you can do on the application layer on the receiving end.
r
Why would you not want event as fast as possible? You should just queue them, return 200OK and have another process that processes them.
p
I am sorry - I should have been more clear. I meant the 2 webhook request with exact same payloads are delivered with 3 ms apart. I understand there can be duplication logic handled at the application layer. I am just confirming if this is an expected behavior. I have shared the examples of 2 webhooks being simultaneously triggered with same payload to @refined-appointment-81829 over DM.