@@ -35,9 +35,9 @@ class Initializer {
3535 /// Creates the text file that will contain the client ID
3636 /// which will be used across all related tools for analytics
3737 /// reporting in GA.
38- static void createClientIdFile ({required File clientFile }) {
39- clientFile .createSync (recursive: true );
40- clientFile .writeAsStringSync (Uuid ().generateV4 ());
38+ static void createClientIdFile ({required File clientIdFile }) {
39+ clientIdFile .createSync (recursive: true );
40+ clientIdFile .writeAsStringSync (Uuid ().generateV4 ());
4141 }
4242
4343 /// Creates the configuration file with the default message
@@ -82,14 +82,8 @@ class Initializer {
8282 required File sessionFile,
8383 DateTime ? sessionIdOverride,
8484 }) {
85- final now = sessionIdOverride ?? clock.now ();
8685 sessionFile.createSync (recursive: true );
87-
88- // `last_ping` has been deprecated, remains included for backward
89- // compatibility
90- sessionFile
91- .writeAsStringSync ('{"session_id": ${now .millisecondsSinceEpoch }, '
92- '"last_ping": ${now .millisecondsSinceEpoch }}' );
86+ writeSessionContents (sessionFile: sessionFile);
9387 }
9488
9589 /// This will check that there is a client ID populated in
@@ -120,7 +114,7 @@ class Initializer {
120114 final clientFile = fs.file (
121115 p.join (homeDirectory.path, kDartToolDirectoryName, kClientIdFileName));
122116 if (! clientFile.existsSync ()) {
123- createClientIdFile (clientFile : clientFile);
117+ createClientIdFile (clientIdFile : clientFile);
124118 }
125119
126120 // Begin initialization checks for the session file
0 commit comments