Skip to content

Commit

Permalink
fix: opt users out of upstream third-party data-sharing (#201010)
Browse files Browse the repository at this point in the history
* fix: add opt out

* fix: set field outside of if statement
  • Loading branch information
rzhao271 authored Dec 15, 2023
1 parent 019e959 commit 541e34d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/vs/platform/telemetry/common/1dsAppender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ async function getClient(instrumentationKey: string, addInternalFlag?: boolean,
appInsightsCore.initialize(coreConfig, []);

appInsightsCore.addTelemetryInitializer((envelope) => {
// Opt the user out of 1DS data sharing
envelope['ext'] = envelope['ext'] ?? {};
envelope['ext']['web'] = envelope['ext']['web'] ?? {};
envelope['ext']['web']['consentDetails'] = '{"GPC_DataSharingOptIn":false}';

if (addInternalFlag) {
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 541e34d

Please sign in to comment.