#pedro-reis_api
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.
โฑ๏ธ 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/1377272615927812099
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi ๐ Subscription Schedules detach from the Subscription they're driving at the end of their phases, not at the beginning of their last phase.
Does that sounds like it aligns with what you're seeing?
Hi Toby! Actually, yes. Good to confirm that's the expected behaviour. The issue I need to solve is (probably an edge case) we are not allowing the user to cancel the schedule on our UI, we are removing the new phase on the dashboard. But by doing this, the user can't schedule again because they already have a schedule attached to their subscription. So what we are trying to do is to listen to a subscription_schedule.update webhook to detaych the schedule from the subscription (using the stripe.subscriptionSchedules.release). Does this make sense?
I'm trying to understand the best way to have clean subscription <> schedule
The problem I'm currently facing is that when advancing the time, there's a clock event active and it doesn't let me release the schedule
Are you able to share the ID of the request that returned the error about the state of the test clock you're using? I'd like to see if the concern there is that the test clock is still advancing, and if the error will likely subside if you wait for the test clock to finish advancing before trying to edit the Subscription Schedule.
One second, will try to replicate
this is the error I'm having: Test clock advancement underway - cannot perform modifications: clock_1RTigZ2sDVri7VidM8hkAtnD
sorry, not sure which event ID I should share with you
Gotcha! I'd expect that error to go away if you let the test clock finish advancing and then try again. If you're using webhooks, you can watch for test_helpers.test_clock.ready Events, which get emitted when Test Clocks finish advancing time.
If you're just doing some one-off style testing, then you can use our CLI to run stripe listen, which will let you easily watch what Events are being generated by your account from your terminal.
https://docs.stripe.com/stripe-cli
yes, I'm using it ๐
but what about production?
I believe I should have no issues with the clock?
Test clocks don't exist in livemode, so they're irrelevant there. They only exist in testmode to allow you to rapidly test Subscription behavior where time needs to pass for you to see how the system will behave.
okay, I will try this for test purposes
thank you very much for your help!