From cf995c398a4d1f77119f6d0fb87517661a6fbedc Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 3 Mar 2025 09:56:15 -0800 Subject: [PATCH 1/3] remove log --- core/util/paths.ts | 6 +----- extensions/vscode/package-lock.json | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/core/util/paths.ts b/core/util/paths.ts index 9a4c77bb2..bd5a69e1a 100644 --- a/core/util/paths.ts +++ b/core/util/paths.ts @@ -5,10 +5,10 @@ import * as path from "path"; import * as JSONC from "comment-json"; import dotenv from "dotenv"; +import { DevEventName } from "@continuedev/config-yaml"; import { IdeType, SerializedContinueConfig } from "../"; import { defaultConfig, defaultConfigJetBrains } from "../config/default"; import Types from "../config/types"; -import { DevEventName } from "@continuedev/config-yaml"; dotenv.config(); @@ -397,10 +397,6 @@ export function migrateV1DevDataFiles() { if (!fs.existsSync(newFilePath)) { fs.copyFileSync(oldFilePath, newFilePath); fs.unlinkSync(oldFilePath); - } else { - console.warn( - `V1 Dev data migration: ${newFilePath} already exists, skipping ${oldFileName}`, - ); } } } diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 9b61f1900..cbcebc34e 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "1.1.2", + "version": "1.1.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "1.1.2", + "version": "1.1.3", "license": "Apache-2.0", "dependencies": { "@continuedev/fetch": "^1.0.3", From a109e6a6d52abd9cade97d0be41b9a267e5a53d4 Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 3 Mar 2025 09:56:30 -0800 Subject: [PATCH 2/3] make sure that allowAnonymousTelemetry isn't undefined --- core/config/yaml/loadYaml.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/config/yaml/loadYaml.ts b/core/config/yaml/loadYaml.ts index bf0515253..b008092e9 100644 --- a/core/config/yaml/loadYaml.ts +++ b/core/config/yaml/loadYaml.ts @@ -415,6 +415,9 @@ export async function loadContinueConfigFromYaml( continueConfig, sharedConfig, ); + if (withShared.allowAnonymousTelemetry === undefined) { + withShared.allowAnonymousTelemetry = true; + } return { config: withShared, From 9ed7c03a515bfe092626a035e663969fe3a5a8f4 Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 3 Mar 2025 09:56:40 -0800 Subject: [PATCH 3/3] don't remount on change to allowAnonymousTelemetry --- gui/src/hooks/CustomPostHogProvider.tsx | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/gui/src/hooks/CustomPostHogProvider.tsx b/gui/src/hooks/CustomPostHogProvider.tsx index 5555f8c12..9f2c722b2 100644 --- a/gui/src/hooks/CustomPostHogProvider.tsx +++ b/gui/src/hooks/CustomPostHogProvider.tsx @@ -1,6 +1,6 @@ import posthog from "posthog-js"; import { PostHogProvider } from "posthog-js/react"; -import React, { PropsWithChildren, useEffect } from "react"; +import { PropsWithChildren, useEffect } from "react"; import { useAppSelector } from "../redux/hooks"; const CustomPostHogProvider = ({ children }: PropsWithChildren) => { @@ -8,8 +8,6 @@ const CustomPostHogProvider = ({ children }: PropsWithChildren) => { (store) => store?.config?.config?.allowAnonymousTelemetry, ); - const [client, setClient] = React.useState(undefined); - useEffect(() => { if (allowAnonymousTelemetry) { posthog.init("phc_JS6XFROuNbhJtVCEdTSYk6gl5ArRrTNMpCcguAXlSPs", { @@ -22,17 +20,12 @@ const CustomPostHogProvider = ({ children }: PropsWithChildren) => { }); posthog.identify(window.vscMachineId); posthog.opt_in_capturing(); - setClient(client); } else { - setClient(undefined); + posthog.opt_out_capturing(); } }, [allowAnonymousTelemetry]); - return allowAnonymousTelemetry ? ( - {children} - ) : ( - <>{children} - ); + return {children}; }; export default CustomPostHogProvider;