Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(billing): default the legacy reported project ids to an empty list (#109715)

Shy Alterc636581db568
diff --git a/frontend/src/mocks/handlers.ts b/frontend/src/mocks/handlers.ts
index 9bcdf878f7a8..89d2dbd14f15 100644
--- a/frontend/src/mocks/handlers.ts
+++ b/frontend/src/mocks/handlers.ts
@@ -279,6 +279,7 @@ export const defaultMocks: Mocks = {
'/api/billing/spend/': { results: [] },
'/api/billing/usage/': { results: [] },
+ '/api/billing/usage/team_options/': { team_id_options: [] },
'/api/organizations/:organization_id/billing/spend/timeseries/': {
count: 0,
next: null,
diff --git a/frontend/src/scenes/billing/billingReads.ts b/frontend/src/scenes/billing/billingReads.ts
index ea85b8e3c73e..3c209216631f 100644
--- a/frontend/src/scenes/billing/billingReads.ts
+++ b/frontend/src/scenes/billing/billingReads.ts
@@ -92,7 +92,7 @@ export const legacyBillingReads: BillingReads = {
},
usageExportUrl: (params) => `/api/billing/usage/export/?${toParams(params)}`,
spendExportUrl: (params) => `/api/billing/spend/export/?${toParams(params)}`,
- reportedProjectIds: async () => (await billingUsageTeamOptionsRetrieve()).team_id_options,
+ reportedProjectIds: async () => (await billingUsageTeamOptionsRetrieve()).team_id_options ?? [],
}
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.