#cabeedelhertz

1 messages · Page 1 of 1 (latest)

worn zodiacBOT
noble glacier
#

Why does your frontend need to make a call to your backend to check subscription status at that point? When you call confirmPayment, the promise should resolve and you should know whether or not the payment was a success

hidden marten
#

But we provision access to the new premium features via the BE. So at some point the FE needs to fetch the new subscription + refresh the user's token in order to get their new feature access. So the FE might be trying to fetch the updated subscription + feature access while the BE is still being updated

noble glacier
#

Yeah, but generally those events are sent to your webhook endpoint ~instantly

#

So it would only be a few seconds where you wouldn't have the data updated

#

You could have some loading screen or splash screen in the interim

hidden marten
#

So do most businesses just rely on eventual consistency when it comes to this. I would think that something like a payment and in session fulfillment would be something you would want with guaranteed immediate consistency.
Do most businesses just live with this race condition?

noble glacier
#

I don't have a good idea as to what most businesses do, but another thing you could do is when you get payment success in the frontend, you could just make a call to your backend that would then reach out to stripe and check subscription status

#

It's up to you