From 18cc10fb7a8b2399df3e4a3b58e4e5c02418d6f8 Mon Sep 17 00:00:00 2001 From: Andrew Kolos Date: Thu, 21 Nov 2024 09:22:07 -0800 Subject: [PATCH 1/3] mutate a clone of the `data` argument rather than `data` itself --- pkgs/unified_analytics/lib/src/event.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From c5d87fa39a4be116edfb897ab0299f4d791ac87c Mon Sep 17 00:00:00 2001 From: Andrew Kolos Date: Thu, 21 Nov 2024 09:24:18 -0800 Subject: [PATCH 2/3] bump version --- pkgs/unified_analytics/CHANGELOG.md | 3 +++ pkgs/unified_analytics/lib/src/constants.dart | 4 ++-- pkgs/unified_analytics/pubspec.yaml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) 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/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 From c0a0ffee35cb95cea046330118bb28579c29bd43 Mon Sep 17 00:00:00 2001 From: Andrew Kolos Date: Thu, 21 Nov 2024 09:28:58 -0800 Subject: [PATCH 3/3] add test --- pkgs/unified_analytics/test/event_test.dart | 8 ++++++++ 1 file changed, 8 insertions(+) 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',