diff --git a/pkgs/unified_analytics/CHANGELOG.md b/pkgs/unified_analytics/CHANGELOG.md index 018127d7a..7e42cbabc 100644 --- a/pkgs/unified_analytics/CHANGELOG.md +++ b/pkgs/unified_analytics/CHANGELOG.md @@ -1,3 +1,6 @@ +## 7.0.1 +- Fixed `UnsupportedError` thrown when Event.exception is called without providing a value for `args`. + ## 7.0.0 - Added a required parameter `screen` to the `Event.devtoolsEvent` constructor. - Added an optional parameter `additionalMetrics` to the `Event.devtoolsEvent` constructor. diff --git a/pkgs/unified_analytics/lib/src/constants.dart b/pkgs/unified_analytics/lib/src/constants.dart index ec4822b62..2be4d0a6c 100644 --- a/pkgs/unified_analytics/lib/src/constants.dart +++ b/pkgs/unified_analytics/lib/src/constants.dart @@ -26,7 +26,7 @@ const String kConfigString = ''' # All other lines are configuration lines. They have # the form "name=value". If multiple lines contain # the same configuration name with different values, -# the parser will default to a conservative value. +# the parser will default to a conservative value. # DISABLING TELEMETRY REPORTING # @@ -87,7 +87,7 @@ const int kMaxLogFileSize = 25 * (1 << 20); const String kLogFileName = 'dart-flutter-telemetry.log'; /// The current version of the package, should be in line with pubspec version. -const String kPackageVersion = '7.0.0'; +const String kPackageVersion = '7.0.1'; /// The minimum length for a session. const int kSessionDurationMinutes = 30; diff --git a/pkgs/unified_analytics/lib/src/event.dart b/pkgs/unified_analytics/lib/src/event.dart index cf6f84f99..ed3066596 100644 --- a/pkgs/unified_analytics/lib/src/event.dart +++ b/pkgs/unified_analytics/lib/src/event.dart @@ -455,7 +455,7 @@ final class Event { }) : eventName = DashEvent.exception, eventData = { 'exception': exception, - ...data..removeWhere((key, value) => value == null), + ...Map.from(data)..removeWhere((key, value) => value == null), }; /// Event that is emitted from the flutter tool when a build invocation diff --git a/pkgs/unified_analytics/pubspec.yaml b/pkgs/unified_analytics/pubspec.yaml index 4a52c6873..f0a99f12c 100644 --- a/pkgs/unified_analytics/pubspec.yaml +++ b/pkgs/unified_analytics/pubspec.yaml @@ -5,7 +5,7 @@ description: >- # LINT.IfChange # When updating this, keep the version consistent with the changelog and the # value in lib/src/constants.dart. -version: 7.0.0 +version: 7.0.1 # LINT.ThenChange(lib/src/constants.dart) repository: https://github.com/dart-lang/tools/tree/main/pkgs/unified_analytics issue_tracker: https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Aunified_analytics diff --git a/pkgs/unified_analytics/test/event_test.dart b/pkgs/unified_analytics/test/event_test.dart index 70b0959bd..2db0b2a0b 100644 --- a/pkgs/unified_analytics/test/event_test.dart +++ b/pkgs/unified_analytics/test/event_test.dart @@ -444,6 +444,14 @@ void main() { expect(constructedEvent.eventData.length, 3); }); + test('Event.exception constructor works when no data is provided', () { + Event generateEvent() => Event.exception( + exception: 'exception', + ); + + expect(generateEvent, returnsNormally); + }); + test('Event.timing constructed', () { Event generateEvent() => Event.timing( workflow: 'workflow',