In the `Event.exception` constructor, modify a clone of the `args` argument instead of `args` itself (#1201)
diff --git a/.github/workflows/cli_config.yml b/.github/workflows/cli_config.yml
index 62b7dd9..ccc2ffe 100644
--- a/.github/workflows/cli_config.yml
+++ b/.github/workflows/cli_config.yml
@@ -3,7 +3,6 @@
on:
pull_request:
- branches: [main]
paths:
- ".github/workflows/cli_config.yml"
- "pkgs/cli_config/**"
diff --git a/.github/workflows/extension_discovery.yml b/.github/workflows/extension_discovery.yml
index ce3a231..d9c1407 100644
--- a/.github/workflows/extension_discovery.yml
+++ b/.github/workflows/extension_discovery.yml
@@ -3,7 +3,6 @@
on:
pull_request:
- branches: [ main ]
paths:
- '.github/workflows/unified_analytics.yml'
- 'pkgs/extension_discovery/**'
diff --git a/.github/workflows/graphs.yml b/.github/workflows/graphs.yml
index 7895e9d..54bd636 100644
--- a/.github/workflows/graphs.yml
+++ b/.github/workflows/graphs.yml
@@ -2,13 +2,12 @@
permissions: read-all
on:
- # Run on PRs and pushes to the default branch.
- push:
- branches: [ main ]
+ # Run CI on all PRs (against any branch) and on pushes to the main branch.
+ pull_request:
paths:
- '.github/workflows/graphs.yml'
- 'pkgs/graphs/**'
- pull_request:
+ push:
branches: [ main ]
paths:
- '.github/workflows/graphs.yml'
diff --git a/.github/workflows/unified_analytics.yml b/.github/workflows/unified_analytics.yml
index 6fe64bb..47a4516 100644
--- a/.github/workflows/unified_analytics.yml
+++ b/.github/workflows/unified_analytics.yml
@@ -3,7 +3,6 @@
on:
pull_request:
- branches: [ main ]
paths:
- '.github/workflows/unified_analytics.yml'
- 'pkgs/unified_analytics/**'
diff --git a/pkgs/unified_analytics/CHANGELOG.md b/pkgs/unified_analytics/CHANGELOG.md
index bee8205..425eb33 100644
--- a/pkgs/unified_analytics/CHANGELOG.md
+++ b/pkgs/unified_analytics/CHANGELOG.md
@@ -1,3 +1,6 @@
+## 6.1.6
+- Fixed `UnsupportedError` thrown when Event.exception is called without providing a value for `args`.
+
## 6.1.5
- Remove any `data` entries with a null value in the `Event.exception` constructor.
diff --git a/pkgs/unified_analytics/lib/src/constants.dart b/pkgs/unified_analytics/lib/src/constants.dart
index 8982ee5..915872a 100644
--- a/pkgs/unified_analytics/lib/src/constants.dart
+++ b/pkgs/unified_analytics/lib/src/constants.dart
@@ -26,7 +26,7 @@
# 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 String kLogFileName = 'dart-flutter-telemetry.log';
/// The current version of the package, should be in line with pubspec version.
-const String kPackageVersion = '6.1.5';
+const String kPackageVersion = '6.1.6';
/// 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 0b5450d..1273b59 100644
--- a/pkgs/unified_analytics/lib/src/event.dart
+++ b/pkgs/unified_analytics/lib/src/event.dart
@@ -496,7 +496,7 @@
}) : 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 8bf4395..c4b6378 100644
--- a/pkgs/unified_analytics/pubspec.yaml
+++ b/pkgs/unified_analytics/pubspec.yaml
@@ -5,7 +5,7 @@
# LINT.IfChange
# When updating this, keep the version consistent with the changelog and the
# value in lib/src/constants.dart.
-version: 6.1.5
+version: 6.1.6
# LINT.ThenChange(lib/src/constants.dart)
repository: https://github.com/dart-lang/tools/tree/main/pkgs/unified_analytics
diff --git a/pkgs/unified_analytics/test/event_test.dart b/pkgs/unified_analytics/test/event_test.dart
index 2809af9..1503146 100644
--- a/pkgs/unified_analytics/test/event_test.dart
+++ b/pkgs/unified_analytics/test/event_test.dart
@@ -443,6 +443,14 @@
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',