#zaddler_subscription-delete
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. Thank you for your patience!
โฑ๏ธ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime! If this thread is closed and you have another question you'll need to start a new thread.
๐ 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/1214268744193417307
๐ Have more to share? You can add more detail below, including code, screenshots, videos, etc.
HI ๐
So the issue is you are attempting to delete the Subscription while the test clock is advancing, correct?
No, I'm trying to create a new subscription, after a paid subscription is deleted while the test clock is running
In either case, you will need to wait until the test_helpers.test_clock.ready webhok event fires. This lets you know the test clock has finished advancing and modifications can be made to the Customer object (which is locked while the test clock advances).
Of course, the problem is that since they are different events, I do not get the customer ID and the deleted subscription ID.
When the event "customer.subscription.deleted" is fired, finally after that "test_helpers.test_clock.ready" occurs, but the event variable, I do not have the ID of the deleted subscription and neither the customer ID
You can filter the Customer List API by test_clock ID to get the Customer ID. https://docs.stripe.com/api/customers/list#list_customers-test_clock
But you are correct, you won't have all of those items handy. You will need to configure your integration to keep track of them and trigger the new subscription creation only when the objects are ready.
Can the test_helpers.test_clock.ready event also occur in production?
Test clocks are only created in Test mode so, no this wouldn't be something you would need to worry about in production.
Yes I understand, but let me explain, if it only exists in Test mode, what progress events are being created in production mode?
All the non-test clock events you see when advancing the test clock and testing subscriptions.
Sorry, I didn't understand your answer ;/
Suppose a user plans to cancel a subscription on March 5th. In production, from March 3 to March 6, what events are triggered?
If you are creating test clocks and hitting these issues when attempting to delete/create customer subscriptions, then you are generating all the other events that you will see in production.
Are you telling me that the test event will not be fired in production? Is it anything but test_clocks?
Suppose a user plans to cancel a subscription on March 5th. In production, from March 3 to March 6, what events are triggered?
All the non-test clock events that you currently see happen in your testing will fire. Everything except the test_helpers.* events
As for processes that lock Stripe Objects, those are very brief and usually we only encounter them when users have async/multi-threaded applications making requests on the same objects at the exact same time.
So, I won't have problems that just when the subscription is deleted, I won't have that error?
Correct
Perfect, thanks!
Great ๐ happy to help ๐