From 750ec8eb82f027f06d1a61b24192fe65271bda59 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Thu, 6 Aug 2026 19:02:48 +0530 Subject: [PATCH] refactor(billing): trim the comments down to what the code can't say MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two of the three added comments restated the expression next to them. Keep only the one carrying the upstream fact — that the API serializes a missing seat `limit` as `0` — and leave the rest of the reasoning in the commit message and PR body. --- src/lib/stores/billing.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/lib/stores/billing.ts b/src/lib/stores/billing.ts index db1c57c98..d2b42db26 100644 --- a/src/lib/stores/billing.ts +++ b/src/lib/stores/billing.ts @@ -277,9 +277,7 @@ export function getServiceLimit( if (serviceId === 'members') { if (!plan?.addons?.seats) return Infinity; - // Plans that don't cap seats omit `limit` in the plan config, and the API - // serializes the missing value as `0`. That means "no seat cap", not - // "no members allowed" — an organization always has at least one member. + // plans that don't cap seats omit `limit`, which the API serializes as `0` return plan.addons.seats?.limit || Infinity; } @@ -477,9 +475,6 @@ export async function checkForUsageLimit(organization: Models.Organization) { const members = organization.total; const memberLimit = getServiceLimit('members'); - // Only a real, positive cap can be exceeded. Without this guard an unknown or - // zero limit turns every organization read-only, which silently disables - // project creation, member invites and every other write action. const membersOverflow = Number.isFinite(memberLimit) && memberLimit > 0 ? Math.max(0, members - memberLimit) : 0;