From c3c20c31724d3dc96465d31c5c1c189441674023 Mon Sep 17 00:00:00 2001 From: Vishal Kumar Singh Date: Sat, 11 Apr 2026 23:30:41 +0530 Subject: [PATCH] Guard billing organization queries when not on Appwrite Cloud checkForMissingPaymentMethod and checkForNewDevUpgradePro call organizations.list with cloud-only filters. Short-circuit on self-hosted so callers cannot trigger 400s for missing attributes. Fixes #2835 --- src/lib/stores/billing.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/stores/billing.ts b/src/lib/stores/billing.ts index 3454d2ba71..2909f69534 100644 --- a/src/lib/stores/billing.ts +++ b/src/lib/stores/billing.ts @@ -586,6 +586,8 @@ export function checkForMarkedForDeletion(org: Models.Organization) { } export async function checkForMissingPaymentMethod() { + if (!isCloud) return; + const starterPlan = getBasePlanFromGroup(BillingPlanGroup.Starter); if (!starterPlan?.$id) { return; @@ -613,6 +615,8 @@ export async function checkForMissingPaymentMethod() { // Display upgrade banner for new users after 1 week for 30 days export async function checkForNewDevUpgradePro(org: Models.Organization) { + if (!isCloud) return; + // browser or plan check. if (!browser || !org.billingPlanDetails.supportsCredits) return;