So I’ve put logs on my webhooks, and it seems that when I cancel a Stuart job (or any other status for that mather), my webhook that handles this change in status is being called 5 times.
In the below image, you can see a portion of these logs. As you can see, the same package and status is being called 4 times… (with one extra on the next page)
Am I doing something wrong or is this a bug?
Thanks for reaching out on our community forum.
I found your test orders in our Sandbox and looked into the logs. It turns out our system tried to send the webhook to your server five times because it’s not getting a Success Response (those 2xx HTTP Status Codes). So, it automatically tries four more times, making it five attempts in total when it doesn’t get the right response.
Based on the above, the problem seems to lie on your server’s side, as it’s not sending back a 2XX status code to acknowledge the webhooks as it’d be the standard. Therefore, I suggest taking a closer look to figure out why in order to solve this issue.
Hope this helps! Let me know if there’s anything else we can help you with.
That’s weird, it should send a 200 response. Locally, this seems to be the case for me.
I will put a log in the controller that returns the response, and perhaps change the code to a 204, which would be more correct.
As we’re having some trouble with our staging server right now, I’ll be testing this tomorrow or in the beginning of next week.
Thank you for the info! I’m sure we’ll find the problem now.
Already back. I got the server working.
I don’t know if this is what did it, but I changed to a 204 code, and now it seems to working and triggering only once.
Thank you again for the help!