#Valaris

1 messages · Page 1 of 1 (latest)

chilly spindleBOT
cloud girder
#

Hi 👋 can you share the ID of a request where you passed in a timestamp for the end date but did not see the corresponding phase get updated?

cobalt ocean
#

b82f710b-ba0d-4e15-b6dc-6aee47e9c332

#

Is that a correct id?

cloud girder
cobalt ocean
#

req_lcMjAAw7r5QkMf

cloud girder
#

Thank you, pulling that up.

cobalt ocean
#

the request where I release

#

req_vJiDaNEHANzTis

cloud girder
#

I see in the response of that request (req_lcMjAAw7r5QkMf) that the end_date of phase 0 is being updated to match the value that you're providing in the request.

It changed from 1678369620 to 1677679755.

cobalt ocean
#

Yes I changed it to test it with the test timer on stripe

#

Then on the test timer I put a higher time than the end date and nothing changes

cloud girder
#

Okay, to restate the problem to make sure I'm understanding. You created a Subscription and Subscription Schedule inside of a Test Clock scenario. You then updated the end_date of the first phase of the Subscription Schedule, but did not see the Subscription get updated when advancing the time of the Test Clock beyond the end_date that you had specified. Does that sound right?

cobalt ocean
#

Yes exactly

#

But with the end_date => 'now' everything works fine

cloud girder
#

Comparing the logs of the Subscription Schedule and the Test Clock, it looks like you released the Subscription Schedule before advancing the Test Clock beyond the end_date of Phase 0.

cobalt ocean
#

Ok, so I need to release after changing the date ? Sounds strange. I also tried without testing clock by puttint strtotime('now + 1 minute') and after 1 minute nothing changed also

cloud girder
#

No, you need to not release the Subscription Schedule, releasing it breaks the association between it and the Subscription which prevents any future changes from happening.

#

The flow I'm seeing is that you released the Subscription Schedule with this request:
https://dashboard.stripe.com/test/logs/req_vJiDaNEHANzTis
Before you advanced the Test Clock's time with this request:
https://dashboard.stripe.com/test/logs/req_3mFZoDA4I69Cu0

#

So when the Test Clock was advanced, the Sub Schedule seems to have already been disassociated from the Subscription, so it is expected that no changes were made.

cobalt ocean
#

what I wanted to do is "I have a mensual subscription and I wnat to change this subscription to be annual, when I click on change subscription then I create a schedule for the mensual to end at the end of the period and then the annual subscription should start"

cloud girder
#

Gotcha, none of that process requires releasing the Subscription Schedule, so I would recommend trying your flow again but without that step.

cobalt ocean
#

An other moderator told me this

cloud girder
#

Correct

#

Sorry, I'm losing sight of the question here.

cobalt ocean
#

I have a mensual subscription and I wnat to change this subscription to be annual, when I click on change subscription then I create a schedule for the mensual to end at the end of the period and then the annual subscription should start.

And I don't get what you are telling me to advance first the time clock before updating the subscription.

But ok without the time clock I tried this (screen), so one minute after clicking the changing sub button the subscription should change from mensual to annual

cloud girder
#

I did not say to advance the Test Clock before updating the Subscription Schedule. I was pointing out that your scenario didn't work as expected because you released the Subscription Schedule before advancing the Test Clock beyond the new end_time that you set.

cobalt ocean
#

Yes I advanced the time clock beyond because beyond then the subscription should have changed

cloud girder
#

But you released the Subscription Schedule before you advanced the Test Clock beyond the end_date of the phase. When you release a Subscription Schedule, it is disassociated form the Subscription that it was attached to, so the Subscription Schedule no longer has any influence on the Subscription and will not make any changes.

#

Please try your flow again, but remove the step that triggered the release of the Subscription Schedule.

cobalt ocean
#

the release is the update of the subscription schedule right ?

cloud girder
#

No

cobalt ocean
#

what is the release then ?

cloud girder
#

Once you release a Subscription Schedule, it will no longer make any changes to the Subscription.

cobalt ocean
#

But I don't do any release in my code, I just create a schedule and I update it I never release it

#

The release is made automatically

cloud girder
cobalt ocean
#

Sorry, I double check my code and yes the release happened in an other file. Thanks your time, I'll try again

cloud girder
#

Any time, happy to help!