#jz-1_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/1432454899937054760
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
mostly curious if it is reliable to batch webhook events in a queue and sorting them by timestamp to get ordered counterpart - i.e. if an invoice or subscription is updated in quick succession
thanks!
Hello
What timestamp are you exactly referring to here?
Can you maybe share a screenshot so that I'm on the same page?
yep one second please
event.created
there is documentation on event ordering but this doc doesn't actually say what the value means
That field looks to be next to the other invoice object fields, so that looks to be the invoice's created timestamp. I do see that events have their own timestamp, looking in to if that can be used this way
appreciate it thank you!
for context: we want to parallel process events but do not want to update out of sync
Still not finding much on this unfortunately. I think it should be when the event itself was created and so it should work to order things in most situations then. That said, when updates happen too close together I think event creation ordering isn't guaranteed but I am double checking with my colleagues.
Okay so unfortunately the created event can't quite be used like that. Sometimes updates can happen the same second and also in rare cases event creation can be out of order for close enough events. So the best way to get the latest object in this case is to just retrieve it when the state is ambiguous.
You can either retrieve it each time you get an updated event, if you want to reduce your API call volume there you can only retrieve an object when the two events are close together (within 30 seconds of each other).
hm i see. is there any alternative flag that stripe emits that would be safe?
this could hit ratelimit pretty quickly if the actual webhook event data isn't reliable
Nothing that we are aware of unfortunately. That's the best way that I am aware of to ensure consistency while reducing API calls. Are events that close together on your objects common?
we haven't done a total audit since its quite difficult from workbench to filter as a connect platform, but we have certainly seen cases where invoices can be paid and immediately payment would fail or be reverted back for other reasons