#benjamin_api

1 messages ยท Page 1 of 1 (latest)

full phoenixBOT
#

๐Ÿ‘‹ 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/1433398363654717552

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

open igloo
#

hi

heady sierra
#

๐Ÿ‘‹ happy to help

open igloo
#

So, yeah i don't know what i'm supposed to do in that situation

heady sierra
#

will be with you shortly, please bear with me

open igloo
#

๐Ÿ‘

heady sierra
#

there's only one entitlement for this customer

#

what are you expecting? and what are you seeing?

open igloo
#

yes, however it's sometimes not returned when i call the "list all active entitlements" while processing the webhook for the subscription:created

#

My current workflow is that i'm only listening to the subscription events (subscription created / updated), then i fetch the active entitltments of the user while processing the webhook.
But it seems like i sometimes get 0 result on the call

heady sierra
open igloo
#

I could, but then it would mean that i would have a weird state in between the two webhook calls

#

My user would be in a subscribed state, but without any information regarding the entitlements

#

(or at least any valid information)

heady sierra
#

or you can keep the subscription pending until you receive the entitlements.active_entitlement_summary.updated event

open igloo
#

I would have to do that. However, is there a guarantee that i will receive webhook events in that specific order, all the time ? First the subscription, THen the update of the entitlements ?

heady sierra
#

no

#

we don't guarantee the order of webhook event deliveries

open igloo
#

Yeah, that's what i thought. So, it adds a lot to the complexity of the state machine on my side.

#

That's why i wanted to know first if this lag between subscription webhook event, and the update of the entitlements on stripe's side was an expected behavior or just a sandbox artifact

heady sierra
#

I think it's not a sandbox issue

open igloo
#

ok, i'll have to think of something then..
Maybe i could just see which entitltemsnt are associated to the product of the subscription, and then use that ?

#

Is there any other reason why a user's entitlement would change, beyond an update to the subscription ?

heady sierra
#

the idea behind entitlements is not to have to update the subscription and change the price in order to control which features a customer should have

open igloo
#

yeah, i understand that, but the fact that they're not updated atomically for a user makes it harder to use..

heady sierra
#

they are updated automatically...

#

it's just not synchronous...

open igloo
#

Yes, that's an issue in my case.. But it's ok, i'll just fetch the product's configuration

#

and do the logic on my side

full phoenixBOT