From ced972d1ea69c1e3ecd74f7b76d136e6d7c73fbc Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 25 Aug 2025 13:51:29 -0700 Subject: [PATCH] fix: reinstate gui telemetry for non-continue users by separating sentry and posthog logic --- gui/src/hooks/TelemetryProviders.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gui/src/hooks/TelemetryProviders.tsx b/gui/src/hooks/TelemetryProviders.tsx index 1a692417d..142d8eae4 100644 --- a/gui/src/hooks/TelemetryProviders.tsx +++ b/gui/src/hooks/TelemetryProviders.tsx @@ -29,7 +29,8 @@ const TelemetryProviders = ({ children }: PropsWithChildren) => { ); useEffect(() => { - if (allowAnonymousTelemetry && hasContinueEmail) { + // PostHog depends only on allowAnonymousTelemetry + if (allowAnonymousTelemetry) { // Initialize PostHog (existing logic) posthog.init("phc_JS6XFROuNbhJtVCEdTSYk6gl5ArRrTNMpCcguAXlSPs", { api_host: "https://app.posthog.com", @@ -41,7 +42,13 @@ const TelemetryProviders = ({ children }: PropsWithChildren) => { }); posthog.identify(window.vscMachineId); posthog.opt_in_capturing(); + } else { + // Disable PostHog + posthog.opt_out_capturing(); + } + // Sentry depends on both allowAnonymousTelemetry and hasContinueEmail + if (allowAnonymousTelemetry && hasContinueEmail) { // Initialize Sentry (new for GUI - enhanced React setup) Sentry.init({ dsn: SENTRY_DSN, @@ -95,9 +102,6 @@ const TelemetryProviders = ({ children }: PropsWithChildren) => { }); Sentry.setUser(anonymizedUser); } else { - // Disable PostHog - posthog.opt_out_capturing(); - // Disable Sentry properly - close the client to stop all network requests try { const client = Sentry.getClient();