fix: reinstate gui telemetry for non-continue users by separating sentry and posthog logic

This commit is contained in:
Nate 2025-08-25 13:51:29 -07:00
parent 505c9d8b92
commit ced972d1ea

View file

@ -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();