From be8502240d81670299670cd63cf4ea67a611d6d2 Mon Sep 17 00:00:00 2001 From: "jargons-ai[bot]" <308145374+jargons-ai[bot]@users.noreply.github.com> Date: Sun, 27 Sep 2026 10:51:57 +0000 Subject: [PATCH 1/3] fix: apply Jargons review suggestions to src/routes/api.billing.webhook.tsx --- src/routes/api.billing.webhook.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/routes/api.billing.webhook.tsx b/src/routes/api.billing.webhook.tsx index 7d22497..a926bb7 100644 --- a/src/routes/api.billing.webhook.tsx +++ b/src/routes/api.billing.webhook.tsx @@ -102,14 +102,15 @@ async function handleEvent(event: BachsEvent): Promise { productId: event.data?.product_id, metadataPlan: event.data?.metadata?.plan, }) - // The customer paid, so never leave them on free: an unrecognised product - // falls back to Pro, logged so the product mapping can be fixed. + // If no plan is matched, it indicates an unrecognised product configuration. + // This should be treated as an error to prevent inconsistent state. if (!matched) { - console.warn( - `[billing] subscription for workspace ${workspaceId} matched no plan; defaulting to pro`, + console.error( + `[billing] subscription for workspace ${workspaceId} matched no known plan for product ID ${event.data?.product_id} and metadata plan ${event.data?.metadata?.plan}; failing webhook processing.`, ) + throw new Error('Unrecognized subscription plan') } - const plan = matched ?? 'pro' + const plan = matched await markWorkspacePaid(workspaceId, plan, { customerId, subscriptionId: event.data?.subscription_id, From 4b8b1bf00101c50731774f201d206c8d3a93b991 Mon Sep 17 00:00:00 2001 From: "jargons-ai[bot]" <308145374+jargons-ai[bot]@users.noreply.github.com> Date: Sun, 27 Sep 2026 10:51:58 +0000 Subject: [PATCH 2/3] fix: apply Jargons review suggestions to src/components/admin/users-table.tsx --- src/components/admin/users-table.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/admin/users-table.tsx b/src/components/admin/users-table.tsx index 23e68c5..920c986 100644 --- a/src/components/admin/users-table.tsx +++ b/src/components/admin/users-table.tsx @@ -121,7 +121,7 @@ function PlanBadge({ plan }: { plan: Plan | null }) { if (plan && plan !== 'free') { return ( - {plan} + {PAID_PLANS[plan].name} ) } @@ -227,4 +227,4 @@ function RunsGrant({ workspaceId }: { workspaceId: string }) { ) -} +} \ No newline at end of file From 4d01dc919cfe10ced5139925d5f163378484052c Mon Sep 17 00:00:00 2001 From: "jargons-ai[bot]" <308145374+jargons-ai[bot]@users.noreply.github.com> Date: Sun, 27 Sep 2026 10:51:59 +0000 Subject: [PATCH 3/3] fix: apply Jargons review suggestions to src/routes/pricing.tsx --- src/routes/pricing.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/routes/pricing.tsx b/src/routes/pricing.tsx index 552cf82..5a14f24 100644 --- a/src/routes/pricing.tsx +++ b/src/routes/pricing.tsx @@ -101,7 +101,7 @@ function PricingPage() { One-click fix PRs {plan === 'free' && signedIn ? ( - + ) : ( {currentPlan === id ? ( - + ) : currentPlan !== 'free' ? ( You're on {PAID_PLANS[currentPlan].name} @@ -242,11 +242,11 @@ function PaidPlanCard({ ) } -function CurrentPlan({ paid = false }: { paid?: boolean }) { +function CurrentPlan({ paid = false, currentPlan }: { paid?: boolean; currentPlan: Plan }) { return paid ? ( - Your current plan + You're on {PAID_PLANS[currentPlan as PaidPlan].name} ) : (