#thebestmoshe
1 messages · Page 1 of 1 (latest)
Hello
No there shouldn't really be "data staleness" in this regard.
Can you provide an example Subscription that you have tested with and seen this?
It's slightly more complex, and I'm unsure exactly which subscription had the issue.
Basically, I have two subscriptions I need to keep in sync. An annual and monthly. If a user creates one, I auto-create the other. If the user cancels one, I auto-cancel the other.
I have a customer who canceled one (monthly), my system auto canceled the other (annual).
However, my system then recreated both subscriptions.
This issue almost never happens, however, occasionally I have issues like this, that seem to be some kind of race condition.
I'm trying to rule out the possibility of getting stale data from Stripe.
The only thing that I can think of is that you may receive Webhooks out-of-order, this is expected (https://stripe.com/docs/webhooks#event-ordering) so potentially that is causing the issue you are experiencing?
Otherwise, this sounds completely dependent on your code. If you retrieve the object then the data will not be stale.
So a "safe" way to proceed would be to retrieve the object when you receive the Webhook to check its current state, instead of relying on the Webhook's data directly.
Possibly related to webhooks coming out of order. I'm still trying to think through the timing of all the events.
Thanks for confirming my data staleness question 🙏
Sure thing