#becca_schedule-downgrade

1 messages ยท Page 1 of 1 (latest)

lucid pathBOT
#

๐Ÿ‘‹ 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/1287873809080123423

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

tired quest
#

Hello, looking in to this. Can you send me the ID of the event that you are looking at as well (evt_1234)

tacit mist
#

yup, grabbing...

#

here's the event for the schedule being updated with the phases (it was created from FromSubscription): evt_1Q2IXfChAQsULn73Wc7IE0OQ

#

here's the customer.subscription.updated event: evt_1Q2IZMChAQsULn735iduabSD

#

the only 2 events on the subscription schedule are creation and that update. nothing further after the test clock advances

lucid pathBOT
tired quest
#

Can you try advancing the test clock again until after the current cycle would end? (March 27 or later)

#

I think the schedule may release after the cycle finishes, rather than as soon as it starts

tacit mist
#

working on it...but Feb 27 is when the downgrade happened, the customer does show a paid invoice for the lower price for 2/27/25

#

oh, huh. that looks better in the dashboard. checking my db records...

tired quest
#

Ah, so what you are reporting is that "X change will happen on Feb 27" still? I was focusing more on the schedule releasing

tacit mist
#

you were right, advancing past 3/27 did trigger a subscription_schedule.released event, but it should have been 2/27 not 3/27

#

checking all the dates from when I set up the schedule phases, pretty sure I did and they were for jan -> feb, but just wanna confirm march wasn't in there heh

#

(suggestion maybe to pass on somewhere: the dashboard is great about letting you click to copy ids and/or navigating to objects by clicking on ids...would be awesome if it handled the timestamps so I don't have to use a webpage to convert them all lol)

#

this is what I'm seeing from the schedule setup:

current phase
start date 1/27/25
end date 2/27/25
phase 0
start date 1/27/25
end date 2/27/25

#

(the timestamp values are the exact same there between current phase and phase 0)

#

the timestamps on the phase match the initial invoice for the higher price exactly

twin sail
#

๐Ÿ‘‹ Stepping in for my teammate, give me a few mins to catch up

tacit mist
#

ty!

twin sail
#

Okay, sorry for the delay

tacit mist
#

no worries!

twin sail
#

I understand you have a schedule with two phases, each phase with a monthly price. The second phase starts Feb 27, 2025. The test clock was advanced to March 10 which means you're in the middle of the first cycle on the second phase

tacit mist
#

especially if you can help me get this resolved teehee ๐Ÿ˜„

twin sail
#

I think this lines up with the fact that the schedule will be released at the end of that cycle, which will be March 27, 2025

tacit mist
#

hmm, looking. I thought there was just the 1 phase

#

evt_1Q2IXfChAQsULn73Wc7IE0OQ this is showing just 1 phase afaict

#

hmm, yeah, afaict I only specified 2/27 for the end. def a bit confused here

twin sail
#

Okay, let me try to put together a timeline

tacit mist
twin sail
#

At that point in time, the time of the test clock was already within that first phase

tacit mist
#

aye, think that's right

#

but not advanced past it, I advanced it to 2/27 after the schedule was there

twin sail
#

Hm, no

#

When the Schedule was created, the test clock was already 2025-03-10 21:09:33 UTC
The test clock was still 2025-03-10 21:09:33 UTC when the Schedule was updated

tacit mist
#

oh

#

that could explain things I guess

tacit mist
#

but iirc submitting just one phase isn't allowed?

twin sail
#

Taking a step back, can you explain what you're trying to test exactly?

tacit mist
#

User is subscribed to Expensive plan say 1/1/25 - 2/1/25. On 1/13/25, user chooses to downgrade to Cheap plan, which should occur not immediately but at the end of the current billing cycle on 2/1/25.

#

I think I'm starting to wrap my head around it, the issue though is that I'm wanting the subscription_schedule.released to happen immediately on the phase change, not another month later.

#

(The user sees a banner on the site reminding them of the pending downgrade, allowing them to cancel it before it happens, and the schedule being released make that go away...so currently the user is being downgraded but still seeing the banner due to the disconnection of those events)

lucid pathBOT
twin sail
#

Ah, I think I see what you mean

tacit mist
#

ok, so making that 2nd phase 1 second long (can't be the same as the start date, must be at least 1s per the error I got when trying) functionally works even though it's hacky as hell and makes me feel dirty lol

short wave
#

becca_schedule-downgrade

#

In that case the Subscription would be released at the end of the current period

tacit mist
#

right that's what I've been doing

short wave
#

Gotcha so did that answer your question? If not, what part is still blocking you?

tacit mist
short wave
#

No, it's definitely not normal to make a fake phase for 1s

tacit mist
#

so I've got 2 phases on the schedule, phase 0 = current price, current end date, phase 1 = new lower price with hacky 1s later end date

short wave
#

Why why a hacky 1s later end date?
I'm sorry I read the backlog but I really don't get what you are trying to do and why you do a hacky 1s period But it's definitely not normal nor what you should do

tacit mist
#

1/1/25: User subscribes to Expensive Plan
1/13/25: User chooses to downgrade (effective end of current cycle) to Cheap Plan, so a subscription_schedule is created from the subscription and updated (this is where the 2 phase with hacky 2nd phase is entered into play)
2/1/25: User subscription should be downgraded and I'm wanting the schedule released here as well

short wave
#

Cool then do a normal second phase for February 1st -> March 1st and either release yourself with code when that transition happens or let it run its course until the end of the current phase (and special-case your UI to now show a warning)

tacit mist
#

ok I think I'm following. the customer.subscription.updated event has the schedule id in it, so I can use that to look up the pending change powering the site banner and release it from there, and then I won't need to listen for the subscription_schedule.released event at all. sound right?

short wave
#

yes

tacit mist
#

alright cool, I will give that a go!

#

thank you, much appreciated! ๐Ÿ™‚

short wave
#

sure thing!

tacit mist
#

(can go ahead and close this thread, hopefully my confidence in this solution isn't misplaced! I can submit for a new thread if I encounter anything else)