subscription.prices.products.name still has the name of the previous plan after I just changed my plan
I just changed my subscription plan to a new plan before the end of billing cycle.
However I checked my Supabase subscriptions table and it still shows the price_id of the previous subscription plan I used.
Not sure why, but I know this behaviour because on the frontend when I go to the Account page it still says "You are currently on the ${subscriptionName} plan" where
const subscriptionName = subscription && subscription.prices.products.name;
And the value I see there is the name of the previous subscription plan!
Whereas on the Stripe checkout I see that the plan I'm using is the new one.
Does the subscription plan name in the DB change on the next billing cycle?
Yes, if don't allow changes to product during billing cycle is checked in stripe. This prevents customers from canceling before billing cycle has ended. I would review settings in stripe and update supabase db. Let me know how it goes.
Happy coding.