#bmizerany

1 messages · Page 1 of 1 (latest)

rugged vineBOT
fleet sequoia
#

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.

idle pike
#

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

fleet sequoia
#

Can you share the request id where you hit the phase per schedule limit so I can further investigate this?

idle pike
#

It's be a long time

#

I moved away from it awhile back

#

It's 10

#

req_KhZEYZHcpTln3j

fleet sequoia
#

Working on this

idle pike
#

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

austere tangle
#

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?

idle pike
#

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

austere tangle
#

yeah but start_date currently is like 2019, why are you passing that value specifically? Has this worked before?

idle pike
#

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

austere tangle
#

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?

idle pike
#

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? ^

#

🙂

austere tangle
#

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

idle pike
#

sorry... schedule

austere tangle
#

ah I see what you said now

idle pike
#

I see two POST /sub_sched. There should one and the next should be POST /sub_sche/sched_id

austere tangle
#

yeah gotcha

idle pike
#

so something I did is now confusing my if statements

#

thank you for your help and rubber ducking