From ce1dbe8b00ba4d6f8d1606354386ad08739fc6a2 Mon Sep 17 00:00:00 2001 From: Dhruwang Jariwala <67850763+Dhruwang@users.noreply.github.com> Date: Fri, 24 Apr 2026 13:08:33 +0530 Subject: [PATCH] fix: apply plan changes immediately for non-standard plans (#7807) --- apps/web/modules/ee/billing/lib/organization-billing.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/web/modules/ee/billing/lib/organization-billing.ts b/apps/web/modules/ee/billing/lib/organization-billing.ts index d8f3bc1ea8e8..f77a916e3a1c 100644 --- a/apps/web/modules/ee/billing/lib/organization-billing.ts +++ b/apps/web/modules/ee/billing/lib/organization-billing.ts @@ -884,7 +884,11 @@ export const switchOrganizationToCloudPlan = async (input: { const currentPlan = resolveCloudPlanFromSubscription(subscription); const currentInterval = resolveSubscriptionInterval(subscription); - const isImmediateUpgrade = CLOUD_PLAN_LEVEL[input.targetPlan] > CLOUD_PLAN_LEVEL[currentPlan]; + // Non-standard plans (custom, unknown) don't follow the normal tier hierarchy, + // so any switch from them to a standard plan should apply immediately. + const isNonStandardCurrentPlan = currentPlan === "custom" || currentPlan === "unknown"; + const isImmediateUpgrade = + isNonStandardCurrentPlan || CLOUD_PLAN_LEVEL[input.targetPlan] > CLOUD_PLAN_LEVEL[currentPlan]; const isSameSelection = currentPlan === input.targetPlan && currentInterval === input.targetInterval; if (isSameSelection) {