diff --git a/pkgs/unified_analytics/CHANGELOG.md b/pkgs/unified_analytics/CHANGELOG.md index dbdbb39cf..19a91ef7a 100644 --- a/pkgs/unified_analytics/CHANGELOG.md +++ b/pkgs/unified_analytics/CHANGELOG.md @@ -1,3 +1,7 @@ +## 5.8.3 + +- [Fix bug](https://github.com/flutter/flutter/issues/143792) when parsing session json file + ## 5.8.2 - Added new event `Event.analyticsException` to track internal errors for this package diff --git a/pkgs/unified_analytics/lib/src/constants.dart b/pkgs/unified_analytics/lib/src/constants.dart index cc7137997..04b749aaf 100644 --- a/pkgs/unified_analytics/lib/src/constants.dart +++ b/pkgs/unified_analytics/lib/src/constants.dart @@ -82,7 +82,7 @@ const int kLogFileLength = 2500; const String kLogFileName = 'dart-flutter-telemetry.log'; /// The current version of the package, should be in line with pubspec version. -const String kPackageVersion = '5.8.2'; +const String kPackageVersion = '5.8.3'; /// The minimum length for a session. const int kSessionDurationMinutes = 30; diff --git a/pkgs/unified_analytics/lib/src/session.dart b/pkgs/unified_analytics/lib/src/session.dart index 77640d68a..de4999b07 100644 --- a/pkgs/unified_analytics/lib/src/session.dart +++ b/pkgs/unified_analytics/lib/src/session.dart @@ -105,7 +105,10 @@ class Session { description: 'message: ${err.message}\nsource: ${err.source}', )); - parseContents(); + // Fallback to setting the session id as the current time + final now = clock.now(); + _sessionId = now.millisecondsSinceEpoch; + _lastPing = now.millisecondsSinceEpoch; } on FileSystemException catch (err) { Initializer.createSessionFile(sessionFile: sessionFile); @@ -115,7 +118,10 @@ class Session { description: err.osError?.toString(), )); - parseContents(); + // Fallback to setting the session id as the current time + final now = clock.now(); + _sessionId = now.millisecondsSinceEpoch; + _lastPing = now.millisecondsSinceEpoch; } } } diff --git a/pkgs/unified_analytics/pubspec.yaml b/pkgs/unified_analytics/pubspec.yaml index eace0d02f..1de690100 100644 --- a/pkgs/unified_analytics/pubspec.yaml +++ b/pkgs/unified_analytics/pubspec.yaml @@ -4,7 +4,7 @@ description: >- to Google Analytics. # When updating this, keep the version consistent with the changelog and the # value in lib/src/constants.dart. -version: 5.8.2 +version: 5.8.3 repository: https://github.com/dart-lang/tools/tree/main/pkgs/unified_analytics environment: