0
Answered

Webhook executing twice?

curtis.lusmore 3 months ago in Integration • updated 3 months ago 7

I have created a webhook and am seeing it regularly execute twice, always 5 minutes apart. When I look at the Event log on https://mytenancy.userecho.com/settings/integrations/webhook/, I noticed that on every occasion that it executes twice the log shows a 5 minute gap between Created and Delivered,and on every occasion that it executes once the log shows no gap between Created and Delivered. Below is a screenshot of my Event log in UserEcho and the event log in my consumer (an Azure Function) with the timestamps linked by arrows. Note that in all cases, my consumer responded with 200 OK within a few seconds.


The screenshot was captured after the latest event was created, and was processed by my consumer, but before UserEcho recorded it as "Delivered". In this case, UserEcho sent another request after 5 minutes, as described above, and now shows 9:19 a.m. as the Delivered time and a Status of 1.




I noticed on the Webhooks documentation page in point 4 it says you must respond with 200 OK, and that if it receives any other response (or presumably if it doesn't receive a response in time, although I'm not sure what the timeout is), it will retry after 1 minute. Is the 1 minute retry still correct, or is it 5 minutes? Could this be the reason that I am seeing retries, even though I am responding with 200 OK? Is there any more information available to me to help diagnose what is happening? Any help would be greatly appreciated - please let me know if I can supply you with any more information.
GOOD, I'M SATISFIED
Satisfaction mark by curtis.lusmore 3 months ago
+1
Under review

Hello, we have checked logs and see that hooks delivered on 2nd attempt most of the times.

UE wait for the response for the 10 seconds and then cancel attempt, and repeat it after 5 minutes.


Is it difficult on your side  to generate response  within 10 seconds?

 

Thanks for the quick reply, Sergey.


That makes a lot of sense, so the problem is that we are timing out. Would it be possible to update the Webhooks documentation page at point 4 to mention the 10 second timeout and 5 minute retry delay? It might save others from the same trouble I had.


As per your suggestion in the below comment, I will update my consumer to simply persist the message and return the response immediately, and then process it in my own time. Thanks.

+1

Perfect, Curtis.

We have updated documentation on our side.

+1

Best practices is, save hook in queue on your side and make do immediate response. Than you can do any things on your side with it.

We see that you leave public request, Should we move it to the Helpdesk or leave it as is?

No, I deliberately left out any sensitive information in my post and made it public so that anybody else with the same problem might find this topic and see the answer. Feel free to leave it public.