#miru_error
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/1499413484503302234
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
๐ happy to help
you need to wait until the test clock's advancement is done before you can do any other updates
you can read more about this here https://docs.stripe.com/billing/testing/test-clocks/api-advanced-usage#monitor-changes
Taking over from my colleague. Let me know if you've any follow-up questions
Hey thanks for the fast reply, and hello ynnoj
That makes sense. But is my understanding correct that its during advancement that events are processed. If WH are listening for these events, they are processed during advancement and for example an sqs listening for these events could trigger a lambda that attempts an update while the testclock is not finished advanceing ? I believe thats happening and im not sure how to wait for testclock to be finished advancing. it needs to advance to trigger renewal.
Yes, I think any invoice.* and/or customer.subscription.* events would fire during the async advancement process. Can you share the req_xxx ID for the request that failed? Looks like you were trying to modify the clock?
im not sure how to wait for testclock to be finished advancing.
You'd listen for thetest_helpers.test_clock.readyevent as per the doc my colleague shared. Once you receive that and the clock isstatus: 'ready'then you can advance it again
req_9XONWwR5yXXIa6 here is the request ID
Then yeah, you're going to need to await for the clock to be ready before modifying objects attached to the clock โ either via that event I said, or polling the API
Right, wait for that event before any sqs triggers a lambda that attempts update
Yes, or check the clock status via the API in the function before you modify the subscription
Ok thanks I was hoping I wouldnt have to make any test specific adjustments in business logic but that seems like the only way
Yeah unfortunately we 'lock' the objects whilst the clock advancements are underway otherwise they could be in a weird state if you're modifying them before the advancement resolves