fix(billing): skip cloud-only organization queries on self-hosted#2973
fix(billing): skip cloud-only organization queries on self-hosted#2973singhvishalkr wants to merge 1 commit intoappwrite:mainfrom
Conversation
checkForMissingPaymentMethod and checkForNewDevUpgradePro call organizations.list with cloud-only filters. Short-circuit on self-hosted so callers cannot trigger 400s for missing attributes. Fixes appwrite#2835
Greptile SummaryAdds Confidence Score: 5/5Safe to merge — minimal, targeted fix with no functional risk. Both guards follow the established pattern ( No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "Guard billing organization queries when ..." | Re-trigger Greptile |
Problem
On self-hosted Appwrite instances, the billing store calls
organizations.listwith cloud-only query filters (Query.equal('platform', Platform.Appwrite)andQuery.notEqual('billingPlan', ...)). These queries return 400 errors because the self-hosted API does not support billing-related fields.Solution
Added early
if (!isCloud) returnguards at the start ofcheckForMissingPaymentMethodandcheckForNewDevUpgradeProinsrc/lib/stores/billing.ts. TheisCloudflag was already imported from$lib/system.How to test
/v1/teamsin the network tabFixes #2835