Skip to content

Commit c4793ce

Browse files
authored
In the Event.exception constructor, modify a clone of the args argument instead of args itself (#1200)
1 parent a6603a4 commit c4793ce

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

pkgs/unified_analytics/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 7.0.1
2+
- Fixed `UnsupportedError` thrown when Event.exception is called without providing a value for `args`.
3+
14
## 7.0.0
25
- Added a required parameter `screen` to the `Event.devtoolsEvent` constructor.
36
- Added an optional parameter `additionalMetrics` to the `Event.devtoolsEvent` constructor.

pkgs/unified_analytics/lib/src/constants.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const String kConfigString = '''
2626
# All other lines are configuration lines. They have
2727
# the form "name=value". If multiple lines contain
2828
# the same configuration name with different values,
29-
# the parser will default to a conservative value.
29+
# the parser will default to a conservative value.
3030
3131
# DISABLING TELEMETRY REPORTING
3232
#
@@ -87,7 +87,7 @@ const int kMaxLogFileSize = 25 * (1 << 20);
8787
const String kLogFileName = 'dart-flutter-telemetry.log';
8888

8989
/// The current version of the package, should be in line with pubspec version.
90-
const String kPackageVersion = '7.0.0';
90+
const String kPackageVersion = '7.0.1';
9191

9292
/// The minimum length for a session.
9393
const int kSessionDurationMinutes = 30;

pkgs/unified_analytics/lib/src/event.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ final class Event {
455455
}) : eventName = DashEvent.exception,
456456
eventData = {
457457
'exception': exception,
458-
...data..removeWhere((key, value) => value == null),
458+
...Map.from(data)..removeWhere((key, value) => value == null),
459459
};
460460

461461
/// Event that is emitted from the flutter tool when a build invocation

pkgs/unified_analytics/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: >-
55
# LINT.IfChange
66
# When updating this, keep the version consistent with the changelog and the
77
# value in lib/src/constants.dart.
8-
version: 7.0.0
8+
version: 7.0.1
99
# LINT.ThenChange(lib/src/constants.dart)
1010
repository: https://github.com/dart-lang/tools/tree/main/pkgs/unified_analytics
1111
issue_tracker: https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Aunified_analytics

pkgs/unified_analytics/test/event_test.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,14 @@ void main() {
444444
expect(constructedEvent.eventData.length, 3);
445445
});
446446

447+
test('Event.exception constructor works when no data is provided', () {
448+
Event generateEvent() => Event.exception(
449+
exception: 'exception',
450+
);
451+
452+
expect(generateEvent, returnsNormally);
453+
});
454+
447455
test('Event.timing constructed', () {
448456
Event generateEvent() => Event.timing(
449457
workflow: 'workflow',

0 commit comments

Comments
 (0)