Skip to content

Commit

Permalink
fix: add opt-out flag (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
rzhao271 committed Dec 19, 2023
1 parent 4361d93 commit ca59824
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/common/1dsClientFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,16 @@ const getAICore = async (key: string, vscodeAPI: typeof vscode, xhrOverride?: IX

appInsightsCore.initialize(coreConfig, []);

appInsightsCore.addTelemetryInitializer((envelope) => {
// Only add this flag when `telemetry.internalTesting` is enabled
appInsightsCore.addTelemetryInitializer((envelope: any) => {
envelope["ext"] = envelope["ext"] ?? {};
envelope["ext"]["web"] = envelope["ext"]["web"] ?? {};
envelope["ext"]["web"]["consentDetails"] = '{"GPC_DataSharingOptIn":false}';

// Only add the remaining flags when `telemetry.internalTesting` is enabled
if (!internalTesting) {
return;
}
envelope["ext"] = envelope["ext"] ?? {};

envelope["ext"]["utc"] = envelope["ext"]["utc"] ?? {};
// Sets it to be internal only based on Windows UTC flagging
envelope["ext"]["utc"]["flags"] = 0x0000811ECD;
Expand Down

0 comments on commit ca59824

Please sign in to comment.