From 1b1b1ea0e03eb5c8db44aa29d64b479dc77d91eb Mon Sep 17 00:00:00 2001 From: Pamela Chia Date: Wed, 15 Jul 2026 19:01:29 +0800 Subject: [PATCH] chore: remove dead telemetry code (#47950) ## Summary Removes two pieces of dead telemetry code found while root-causing the docs pageview re-fire investigation (GROWTH-997, closed with no fix needed). Pure deletion, 30 lines, no behavior change. ## Changes - Delete `apps/www/app/ConsentWrapper.tsx`: an unwired third `PageTelemetry` mount. www already mounts `PageTelemetry` in `pages/_app.tsx` (Pages Router) and `app/providers.tsx` (App Router); nothing imports this wrapper. - Remove the exported `POSTHOG_URL` constant from `apps/studio/lib/constants/index.ts`: zero consumers. The CSP allowlist in `apps/studio/csp.ts` defines and uses its own local `POSTHOG_URL`, which stays. ## Testing Deadness verified before deletion, on current master: - [x] Repo-wide grep for `ConsentWrapper`: only self-references inside the deleted file - [x] Repo-wide grep for `POSTHOG_URL`: remaining references are the `csp.ts` local const only ## Linear - fixes GROWTH-1002 ## Summary by CodeRabbit * **Bug Fixes** * Removed an obsolete consent-related page wrapper to streamline page behavior. * Updated application configuration handling without changing existing payment or usage settings. * **Refactor** * Simplified internal configuration and page composition while preserving the existing user experience. --- apps/studio/lib/constants/index.ts | 6 ------ apps/www/app/ConsentWrapper.tsx | 24 ------------------------ 2 files changed, 30 deletions(-) delete mode 100644 apps/www/app/ConsentWrapper.tsx diff --git a/apps/studio/lib/constants/index.ts b/apps/studio/lib/constants/index.ts index 2dd90f2652d..b177951c716 100644 --- a/apps/studio/lib/constants/index.ts +++ b/apps/studio/lib/constants/index.ts @@ -59,12 +59,6 @@ export const GOTRUE_ERRORS = { export const STRIPE_PUBLIC_KEY = process.env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY || 'pk_test_XVwg5IZH3I9Gti98hZw6KRzd00v5858heG' -export const POSTHOG_URL = - process.env.NEXT_PUBLIC_ENVIRONMENT === 'staging' || - process.env.NEXT_PUBLIC_ENVIRONMENT === 'local' - ? 'https://ph.supabase.green' - : 'https://ph.supabase.com' - export const USAGE_APPROACHING_THRESHOLD = 0.75 export const DOCS_URL = process.env.NEXT_PUBLIC_DOCS_URL || 'https://supabase.com/docs' diff --git a/apps/www/app/ConsentWrapper.tsx b/apps/www/app/ConsentWrapper.tsx deleted file mode 100644 index 595ad4a0bad..00000000000 --- a/apps/www/app/ConsentWrapper.tsx +++ /dev/null @@ -1,24 +0,0 @@ -'use client' - -import { IS_PLATFORM, PageTelemetry } from 'common' -import { useConsentToast } from 'ui-patterns/consent' -import { API_URL } from '~/lib/constants' - -interface ConsentWrapperProps { - children: React.ReactNode -} - -export function ConsentWrapper({ children }: ConsentWrapperProps) { - const { hasAcceptedConsent } = useConsentToast() - - return ( - <> - {children} - - - ) -}