#mclowrider_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/1377967105307312269
๐ 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.
- mclowrider_3dsecure-payment-intents, 18 hours ago, 40 messages
- mclowrider_api, 19 hours ago, 5 messages
hi there!
Hello!
What do you mean by this?
be used as a sequence for when an object was updated
An integration can ignore older updates if it has already processed a newer event
Per object that is, if that makes sense
As a mechanism to handle events arriving out of order.
Sure
Recently we received two invoice events out of order. We received an invoice payment failed eventually after the invoice payment succeeded event
This can happen according to the docs
yep
We are thinking of the best way to handle this in our system
In that scenario we essentially renewed the customers access to our product then revoked it.
We want to fix this so it doesn't happen again
Could we use the timestamp of the invoice events in that scenario to determine order. So if we stored the invoice event timestamp in the payload we can ignore older invoice events
The AI assistant talked about a sequence number but I've never seen that.
the recommended solution is when you receive an event, to make an API call to retrive the object. this way you can see its latest status. for example getting an event about a failed payment, but then when you retrive the payment with the API its status is actually succeeded
That just narrows the possibility of a race condition but doesn't eliminate it?
With version/sequence/timestamp numbers we can ignore older events if we already processed the new state
Just checking if any such version/timestamp/sequence exist on Stripe objects/events as it would really make handling out of order a lot easier. Using that key integrations would be able to implement optimistic concurrency locking if that makes sense..
yes I think you could use the event timestamp for this. otherwise there's no "sequence" you could use
Is this the created timestamp on the event?
Or is the there an updated timestamp on every event object
sorry I just double checked, and there's no timpestamps on the Event payload: https://docs.stripe.com/api/events/object?api-version=2025-02-24.acacia. also there isn't one on the objects themselves for their latest update.
so what you are trying to do is not possible I think. instead you should do what I recommended earlier:
when you receive an event, to make an API call to retrive the object. this way you can see its latest status.
Ok
It probably our biggest challenge with the Stripe integration
As we also have to consider rate limits on the API
Might be one to feedback to the product teams. An object version/sequence would really help to handle this without having to call Stripe back each time and potentially exhaust our API limit.
yep, makes sense!
Thanks soma. Not the answer I was looking for but at least I have a way forward.. Looking forward to an object version at some point ๐