Skip to content

Commit cc2bec1

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

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+
## 6.1.6
2+
- Fixed `UnsupportedError` thrown when Event.exception is called without providing a value for `args`.
3+
14
## 6.1.5
25
- Remove any `data` entries with a null value in the `Event.exception` constructor.
36

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 = '6.1.5';
90+
const String kPackageVersion = '6.1.6';
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
@@ -496,7 +496,7 @@ final class Event {
496496
}) : eventName = DashEvent.exception,
497497
eventData = {
498498
'exception': exception,
499-
...data..removeWhere((key, value) => value == null),
499+
...Map.from(data)..removeWhere((key, value) => value == null),
500500
};
501501

502502
/// 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: 6.1.5
8+
version: 6.1.6
99
# LINT.ThenChange(lib/src/constants.dart)
1010
repository: https://github.com/dart-lang/tools/tree/main/pkgs/unified_analytics
1111

pkgs/unified_analytics/test/event_test.dart

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

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

0 commit comments

Comments
 (0)