#zaddler_subscription-delete

1 messages ยท Page 1 of 1 (latest)

robust nightBOT
#

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

ember sundialBOT
harsh mural
#

HI ๐Ÿ‘‹

So the issue is you are attempting to delete the Subscription while the test clock is advancing, correct?

upper scarab
#

No, I'm trying to create a new subscription, after a paid subscription is deleted while the test clock is running

harsh mural
#

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).

upper scarab
#

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

harsh mural
#

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.

upper scarab
#

Can the test_helpers.test_clock.ready event also occur in production?

harsh mural
#

Test clocks are only created in Test mode so, no this wouldn't be something you would need to worry about in production.

upper scarab
#

Yes I understand, but let me explain, if it only exists in Test mode, what progress events are being created in production mode?

harsh mural
#

All the non-test clock events you see when advancing the test clock and testing subscriptions.

upper scarab
#

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?

harsh mural
#

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.

upper scarab
#

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?

harsh mural
#

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.

upper scarab
#

So, I won't have problems that just when the subscription is deleted, I won't have that error?

ember sundialBOT
harsh mural
#

Correct

upper scarab
harsh mural
#

Great ๐ŸŽ‰ happy to help ๐Ÿ™‚