#bmizerany
1 messages · Page 1 of 1 (latest)
Hi, taking a look at the request
It looks like you'd need to pass the current phase as well, then add the next phase.
I'm trying to update the current phase. There is no "next" phase.
I used to have the code append phases by default, as you suggested, but then I hit the phase per schedule limit
it was pretty low iirc
maybe 5?
so if my customer is upgrading and downgrading more than a few times, they're going to get errors
Can you share the request id where you hit the phase per schedule limit so I can further investigate this?
Working on this
so if my customer changes their mind or our sales people make tweaks to schedules 10 times, then we get an error
before the schedule is relesaed
Alternatively, is it better to just create a whole new schedule and use from_subscription for each change? That seems more complicated than it should be though
Well, that would end up being the same problem because I have to update the schedule after creating it with from_subscription since one cannot set phases on a create using from_subscription
usually this error means nothing is changing on the schedule. Are you making a real change or basically passing the data as it already is right now?
real change
new prices
scenario: customer schedules Free Plan and then wants Pro 1hr later
same thing but there is a 1mo delay in another test case
and billing interval is monthly
yeah but start_date currently is like 2019, why are you passing that value specifically? Has this worked before?
it's a test clock
that is the start date of the test clock
That date has been working in test clocks for 9 months
All of my tests use that date, and there is only one test failing, and it's the one with the error that started this thread
sounds good
okay so I'm digging into this with a colleague. You have changed that test clock a few times, like it was Jan 24 2020 earlier and now it's exactly the boundary of the current cycle so Jan 31 00:00
Has that exact time on the clock worked before? Is this something you tried?
it has
I think I see my problem
I think my code is getting some response back from Stripe that it is interpreting as "no subscription" and so it creates one
except it's a dup
and then later it wants to upgrade the sub but gets the old and with it: the old start_date, and then trys to update the new with the other subs start_date, which is in the past,
so then stripe is all like "you must give me something now or in the future"
btw may I put in a request to change the confusing double negative error message something something like that? ^
🙂
yeah I don't really follow what you mean. That Schedule was created by a Subscription that does not have a start date in 2019
ah I see what you said now
I see two POST /sub_sched. There should one and the next should be POST /sub_sche/sched_id
yeah gotcha