diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index de09ab8f93960edeccfb9a3bd86a7e54bea33e86..32f3bb2e8085aa4fd0d61b4081ca22147e83a308 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -26,7 +26,7 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment' import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IURLService } from 'vs/platform/url/common/url'; import { URLHandlerChannelClient, URLHandlerRouter } from 'vs/platform/url/common/urlIpc'; -import { ITelemetryService, machineIdKey, trueMachineIdKey } from 'vs/platform/telemetry/common/telemetry'; +import { ITelemetryService, machineIdKey } from 'vs/platform/telemetry/common/telemetry'; import { NullTelemetryService, combinedAppender, LogAppender } from 'vs/platform/telemetry/common/telemetryUtils'; import { TelemetryAppenderClient } from 'vs/platform/telemetry/node/telemetryIpc'; import { TelemetryService, ITelemetryServiceConfig } from 'vs/platform/telemetry/common/telemetryService'; @@ -365,8 +365,8 @@ export class CodeApplication extends Disposable { // Resolve unique machine ID this.logService.trace('Resolving machine identifier...'); - const { machineId, trueMachineId } = await this.resolveMachineId(); - this.logService.trace(`Resolved machine identifier: ${machineId} (trueMachineId: ${trueMachineId})`); + const machineId = await this.resolveMachineId(); + this.logService.trace(`Resolved machine identifier: ${machineId}`); // Spawn shared process after the first window has opened and 3s have passed const sharedProcess = this.instantiationService.createInstance(SharedProcess, machineId, this.userEnv); @@ -387,7 +387,7 @@ export class CodeApplication extends Disposable { }); // Services - const appInstantiationService = await this.createServices(machineId, trueMachineId, sharedProcess, sharedProcessReady); + const appInstantiationService = await this.createServices(machineId, sharedProcess, sharedProcessReady); // Create driver if (this.environmentService.driverHandle) { @@ -412,32 +412,21 @@ export class CodeApplication extends Disposable { } } - private async resolveMachineId(): Promise<{ machineId: string, trueMachineId?: string }> { + private async resolveMachineId(): Promise { // We cache the machineId for faster lookups on startup - // and resolve it only once initially if not cached + // and resolve it only once initially if not cached or we need to replace the macOS iBridge device let machineId = this.stateService.getItem(machineIdKey); - if (!machineId) { + if (!machineId || (isMacintosh && machineId === '6c9d2bc8f91b89624add29c0abeae7fb42bf539fa1cdb2e3e57cd668fa9bcead')) { machineId = await getMachineId(); this.stateService.setItem(machineIdKey, machineId); } - // Check if machineId is hashed iBridge Device - let trueMachineId: string | undefined; - if (isMacintosh && machineId === '6c9d2bc8f91b89624add29c0abeae7fb42bf539fa1cdb2e3e57cd668fa9bcead') { - trueMachineId = this.stateService.getItem(trueMachineIdKey); - if (!trueMachineId) { - trueMachineId = await getMachineId(); - - this.stateService.setItem(trueMachineIdKey, trueMachineId); - } - } - - return { machineId, trueMachineId }; + return machineId; } - private async createServices(machineId: string, trueMachineId: string | undefined, sharedProcess: SharedProcess, sharedProcessReady: Promise>): Promise { + private async createServices(machineId: string, sharedProcess: SharedProcess, sharedProcessReady: Promise>): Promise { const services = new ServiceCollection(); switch (process.platform) { @@ -489,7 +478,7 @@ export class CodeApplication extends Disposable { const appender = combinedAppender(new TelemetryAppenderClient(channel), new LogAppender(this.logService)); const commonProperties = resolveCommonProperties(product.commit, product.version, machineId, product.msftInternalDomains, this.environmentService.installSourcePath); const piiPaths = this.environmentService.extensionsPath ? [this.environmentService.appRoot, this.environmentService.extensionsPath] : [this.environmentService.appRoot]; - const config: ITelemetryServiceConfig = { appender, commonProperties, piiPaths, trueMachineId, sendErrorTelemetry: true }; + const config: ITelemetryServiceConfig = { appender, commonProperties, piiPaths, sendErrorTelemetry: true }; services.set(ITelemetryService, new SyncDescriptor(TelemetryService, [config])); } else { diff --git a/src/vs/platform/telemetry/common/telemetry.ts b/src/vs/platform/telemetry/common/telemetry.ts index 60a957fafcad59185025fa0d42924da346339c29..5b165a34e29d69d4576513a78bdc46e761ef55c5 100644 --- a/src/vs/platform/telemetry/common/telemetry.ts +++ b/src/vs/platform/telemetry/common/telemetry.ts @@ -55,5 +55,4 @@ export const currentSessionDateStorageKey = 'telemetry.currentSessionDate'; export const firstSessionDateStorageKey = 'telemetry.firstSessionDate'; export const lastSessionDateStorageKey = 'telemetry.lastSessionDate'; export const machineIdKey = 'telemetry.machineId'; -export const trueMachineIdKey = 'telemetry.trueMachineId'; export const crashReporterIdStorageKey = 'crashReporter.guid'; diff --git a/src/vs/platform/telemetry/common/telemetryService.ts b/src/vs/platform/telemetry/common/telemetryService.ts index 438abc1092b384391972ae61cb7b77ca1c8655c2..49c4d59d5d53ab20959a642191208a0f37e5d95c 100644 --- a/src/vs/platform/telemetry/common/telemetryService.ts +++ b/src/vs/platform/telemetry/common/telemetryService.ts @@ -20,7 +20,6 @@ export interface ITelemetryServiceConfig { sendErrorTelemetry?: boolean; commonProperties?: Promise<{ [name: string]: any }>; piiPaths?: string[]; - trueMachineId?: string; } export class TelemetryService implements ITelemetryService { @@ -76,13 +75,6 @@ export class TelemetryService implements ITelemetryService { usingFallbackGuid: { classification: 'SystemMetaData', purpose: 'BusinessInsight', isMeasurement: true }; }; this.publicLog2<{ usingFallbackGuid: boolean }, MachineIdFallbackClassification>('machineIdFallback', { usingFallbackGuid: !isHashedId }); - - if (config.trueMachineId) { - type MachineIdDisambiguationClassification = { - correctedMachineId: { endPoint: 'MacAddressHash', classification: 'EndUserPseudonymizedInformation', purpose: 'FeatureInsight' }; - }; - this.publicLog2<{ correctedMachineId: string }, MachineIdDisambiguationClassification>('machineIdDisambiguation', { correctedMachineId: config.trueMachineId }); - } }); } }