#ares_webhooks
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1483057086563876946
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
๐ happy to help
hi
you mean you received the event twice?
We seen some cases when we get a webhook event twice. It fails on first try for unknown reasons and ends up succeeding the second try. here is one of the event IDs: evt_2T9vClqWxM0n7YqD1o6nvqzW
yes we did attempt to send the event twice, because the first time your webhook handler returned a 500 HTTP response (Internal Server Error)
you need to check in your logs why it failed the first time
this is on your side not on ours
When we trace back to the exact instance in the logs we don't see anything related to "internal server error".
So there is this related error message for the same event: SequelizeUniqueConstraintError: Validation error but if that is the case, how would it succeed the second time. I mean if there was a contraint error, it will always be as such for the same event.
where is that SequelizeUniqueConstraintError error coming form?
from the event handler, which basically recieves the event from stripe. So this error means the event object has some data attribute which violates the DB constraints but then it doesn't happen upon the event retry.
maybe it's a auto-increment issue on your end when you're trying to add two entities in parallel
both events have same time stamp and it is hard to see which one was sent first. If in the first try it was a success and in the second try it failed then it makes sense. Is that something you can check? I mean whether the first try was a success or failure.
in all cases, you shouldn't use auto-increment, why not just rely on the IDs from Stripe?
it is for other analytical stuff. I mean our internal records are kinda linked through these IDs. Also we have other payment processors that also share the table so cannot rely on stripe IDs.
I meant instead of having auto-increment, use IDs whether it's Stripe IDs or other processor IDs it doesn't matter
if you have other providers that could explain why the first one is failing and the second succeeding
in all cases, there are 2 recommendations here:
1- use IDs instead of auto-increment
2- use a queue to streamline the operations on your side