#basieboots_best-practices
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/1231957553882333224
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- basieboots_webhooks, 5 hours ago, 36 messages
Hi 👋 can you elaborate a bit more on what you're trying to do? I ask because webhook endpoints should be built to quickly respond to our requests, rather than to make API requests, so it's a little unusual to hear them discussed alongside idempotency.
the php example in the youtube video is doing a quick check to see if the event is a duplicate event using idempotency, but since we're using node/javascript it doesn't translate well especially since your javascript library doesn't show the webhooks functions associated with the stripe javascript library
it seems like a reasonable method of ensuring that there's no duplicate events happening, but none of the node documentation mentions that check
That would be a check you would do on your end I would think. It sounds like you're trying to check whether you're receiving an Event that you've already received and processed. To do that you'll need to first begin tracking the Events that your endpoint has processed, which would need to be logged on your end. Then when you receive a request with an Event, after checking it's validity you'd check whether you've already processed the Event against your records.
I'm not too familiar with exactly what that youtube video shows. Would you be able to pull a screenshot or code sample showing the behavior in php you're describing?
if !WebhookEvent.find_by(source: params[:source], other stuff) end
the video is from 2019 so perhaps you've changed processes sicne the php example doesn't mention that find check
here's from the best practices and this is what I was thinking to incorporate: Handle duplicate events
Webhook endpoints might occasionally receive the same event more than once. You can guard against duplicated event receipts by making your event processing idempotent. One way of doing this is logging the events you’ve processed, and then not processing already-logged events.
I can see that your dashboard is logging all the events and the events themselves contain an idempotency key under their request field... are you saying your api doesn't have a function to search that and we should do it manually on our side? We'll be keeping track of all events so it's possible for us to do that