Skip to content

Conversation

pauldambra
Copy link
Member

on self hosted installs as I click around I may trigger some code that hits the various billing logics. they check if i'm an admin or higher and i am, so they try and call billing APIs, and then show an error toast.

Screenshot 2025-09-09 at 15 50 55

but there's nothing I can do about it

so, let's just not?

@pauldambra pauldambra requested a review from a team September 9, 2025 15:04
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, no comments

Edit Code Review Bot Settings | Greptile

Copy link
Contributor

github-actions bot commented Sep 9, 2025

Size Change: +95 B (0%)

Total Size: 2.73 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 2.73 MB +95 B (0%)

compressed-size-action

Copy link
Contributor

@pawel-cebula pawel-cebula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we check against isCloud rather than isCloudOrDev? I wouldn't want to obscure that this won't trigger locally in dev.

(Though I might have wrong assumptions about the definitions of cloud/dev in this context)

@@ -97,7 +105,7 @@ export const billingSpendLogic = kea<billingSpendLogicType>([
null as BillingSpendResponse | null,
{
loadBillingSpend: async () => {
if (!canAccessBilling(values.currentOrganization)) {
if (!canAccessBilling(values.currentOrganization) || !values.isCloudOrDev) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we check against isCloud rather than isCloudOrDev? I wouldn't want to obscure that this won't trigger locally in dev.

(Though I might have wrong assumptions about the definitions of cloud/dev in this context)

i think this means in posthog cloud, or in local development on an engineer machine, and otherwise not

i guess then maybe i should invert this and be more clear so there's a !isSelfHosted so we don't have to keep adding conditions like isCI 🤔

@@ -3578,8 +3578,10 @@ export interface PreflightStatus {
client_id?: string
}
}
/** Whether PostHog is running in DEBUG mode. */
/** Whether PostHog is running in settings.DEBUG or settings.E2E_TESTING. */
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slightly weird that debug includes E2E_TESTING, but let's maintain that since it already exists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants