@@ -47,7 +47,6 @@ import { INativeHostMainService } from 'vs/platform/native/electron-main/nativeH
47
47
import { OneDataSystemAppender } from 'vs/platform/telemetry/node/1dsAppender' ;
48
48
import { ITelemetryServiceConfig , TelemetryService } from 'vs/platform/telemetry/common/telemetryService' ;
49
49
import { getPiiPathsFromEnvironment , isInternalTelemetry , ITelemetryAppender , supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils' ;
50
- import { Promises } from 'vs/base/node/pfs' ;
51
50
import { resolveCommonProperties } from 'vs/platform/telemetry/common/commonProperties' ;
52
51
import { hostname , release } from 'os' ;
53
52
@@ -784,19 +783,7 @@ export class CodeWindow extends Disposable implements ICodeWindow {
784
783
const config : ITelemetryServiceConfig = {
785
784
appenders,
786
785
sendErrorTelemetry : false ,
787
- commonProperties : ( async ( ) => {
788
- let machineId : string | undefined = undefined ;
789
- try {
790
- const storageContents = await Promises . readFile ( this . environmentMainService . stateResource . fsPath ) ;
791
- machineId = JSON . parse ( storageContents . toString ( ) ) [ machineIdKey ] ;
792
- } catch ( error ) {
793
- if ( error . code !== 'ENOENT' ) {
794
- this . logService . error ( error ) ;
795
- }
796
- }
797
-
798
- return resolveCommonProperties ( this . fileService , release ( ) , hostname ( ) , process . arch , this . productService . commit , this . productService . version , machineId , isInternal , installSourcePath ) ;
799
- } ) ( ) ,
786
+ commonProperties : resolveCommonProperties ( this . fileService , release ( ) , hostname ( ) , process . arch , this . productService . commit , this . productService . version , this . stateMainService . getItem < string > ( machineIdKey ) , isInternal , installSourcePath ) ,
800
787
piiPaths : getPiiPathsFromEnvironment ( this . environmentMainService )
801
788
} ;
802
789
@@ -812,7 +799,7 @@ export class CodeWindow extends Disposable implements ICodeWindow {
812
799
reason : string | undefined ;
813
800
code : number | undefined ;
814
801
} ;
815
- telemetryService . publicLog2 < WindowAdminErrorEvent , WindowAdminErrorClassification > ( 'windowadminerror' , { reason : details . reason , code : details . exitCode } ) ;
802
+ await telemetryService . publicLog2 < WindowAdminErrorEvent , WindowAdminErrorClassification > ( 'windowadminerror' , { reason : details . reason , code : details . exitCode } ) ;
816
803
}
817
804
818
805
// Inform user
@@ -829,7 +816,7 @@ export class CodeWindow extends Disposable implements ICodeWindow {
829
816
} , this . _win ) ;
830
817
831
818
// Ensure to await flush telemetry
832
- await Promise . all ( appenders . map ( a => a . flush ( ) ) ) ;
819
+ await Promise . all ( appenders . map ( appender => appender . flush ( ) ) ) ;
833
820
834
821
// Exit
835
822
await this . destroyWindow ( false , false ) ;
0 commit comments