@@ -26,7 +26,7 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment'
2626import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
2727import { IURLService } from 'vs/platform/url/common/url' ;
2828import { URLHandlerChannelClient , URLHandlerRouter } from 'vs/platform/url/common/urlIpc' ;
29- import { ITelemetryService , machineIdKey , trueMachineIdKey } from 'vs/platform/telemetry/common/telemetry' ;
29+ import { ITelemetryService , machineIdKey } from 'vs/platform/telemetry/common/telemetry' ;
3030import { NullTelemetryService , combinedAppender , LogAppender } from 'vs/platform/telemetry/common/telemetryUtils' ;
3131import { TelemetryAppenderClient } from 'vs/platform/telemetry/node/telemetryIpc' ;
3232import { TelemetryService , ITelemetryServiceConfig } from 'vs/platform/telemetry/common/telemetryService' ;
@@ -365,8 +365,8 @@ export class CodeApplication extends Disposable {
365365
366366 // Resolve unique machine ID
367367 this . logService . trace ( 'Resolving machine identifier...' ) ;
368- const { machineId, trueMachineId } = await this . resolveMachineId ( ) ;
369- this . logService . trace ( `Resolved machine identifier: ${ machineId } (trueMachineId: ${ trueMachineId } ) ` ) ;
368+ const machineId = await this . resolveMachineId ( ) ;
369+ this . logService . trace ( `Resolved machine identifier: ${ machineId } ` ) ;
370370
371371 // Spawn shared process after the first window has opened and 3s have passed
372372 const sharedProcess = this . instantiationService . createInstance ( SharedProcess , machineId , this . userEnv ) ;
@@ -387,7 +387,7 @@ export class CodeApplication extends Disposable {
387387 } ) ;
388388
389389 // Services
390- const appInstantiationService = await this . createServices ( machineId , trueMachineId , sharedProcess , sharedProcessReady ) ;
390+ const appInstantiationService = await this . createServices ( machineId , sharedProcess , sharedProcessReady ) ;
391391
392392 // Create driver
393393 if ( this . environmentService . driverHandle ) {
@@ -412,32 +412,21 @@ export class CodeApplication extends Disposable {
412412 }
413413 }
414414
415- private async resolveMachineId ( ) : Promise < { machineId : string , trueMachineId ?: string } > {
415+ private async resolveMachineId ( ) : Promise < string > {
416416
417417 // We cache the machineId for faster lookups on startup
418- // and resolve it only once initially if not cached
418+ // and resolve it only once initially if not cached or we need to replace the macOS iBridge device
419419 let machineId = this . stateService . getItem < string > ( machineIdKey ) ;
420- if ( ! machineId ) {
420+ if ( ! machineId || ( isMacintosh && machineId === '6c9d2bc8f91b89624add29c0abeae7fb42bf539fa1cdb2e3e57cd668fa9bcead' ) ) {
421421 machineId = await getMachineId ( ) ;
422422
423423 this . stateService . setItem ( machineIdKey , machineId ) ;
424424 }
425425
426- // Check if machineId is hashed iBridge Device
427- let trueMachineId : string | undefined ;
428- if ( isMacintosh && machineId === '6c9d2bc8f91b89624add29c0abeae7fb42bf539fa1cdb2e3e57cd668fa9bcead' ) {
429- trueMachineId = this . stateService . getItem < string > ( trueMachineIdKey ) ;
430- if ( ! trueMachineId ) {
431- trueMachineId = await getMachineId ( ) ;
432-
433- this . stateService . setItem ( trueMachineIdKey , trueMachineId ) ;
434- }
435- }
436-
437- return { machineId, trueMachineId } ;
426+ return machineId ;
438427 }
439428
440- private async createServices ( machineId : string , trueMachineId : string | undefined , sharedProcess : SharedProcess , sharedProcessReady : Promise < Client < string > > ) : Promise < IInstantiationService > {
429+ private async createServices ( machineId : string , sharedProcess : SharedProcess , sharedProcessReady : Promise < Client < string > > ) : Promise < IInstantiationService > {
441430 const services = new ServiceCollection ( ) ;
442431
443432 switch ( process . platform ) {
@@ -489,7 +478,7 @@ export class CodeApplication extends Disposable {
489478 const appender = combinedAppender ( new TelemetryAppenderClient ( channel ) , new LogAppender ( this . logService ) ) ;
490479 const commonProperties = resolveCommonProperties ( product . commit , product . version , machineId , product . msftInternalDomains , this . environmentService . installSourcePath ) ;
491480 const piiPaths = this . environmentService . extensionsPath ? [ this . environmentService . appRoot , this . environmentService . extensionsPath ] : [ this . environmentService . appRoot ] ;
492- const config : ITelemetryServiceConfig = { appender, commonProperties, piiPaths, trueMachineId , sendErrorTelemetry : true } ;
481+ const config : ITelemetryServiceConfig = { appender, commonProperties, piiPaths, sendErrorTelemetry : true } ;
493482
494483 services . set ( ITelemetryService , new SyncDescriptor ( TelemetryService , [ config ] ) ) ;
495484 } else {
0 commit comments