Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In the Event.exception constructor, modify a clone of the args argument instead of args itself #1200

Merged
merged 3 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkgs/unified_analytics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions pkgs/unified_analytics/lib/src/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/unified_analytics/lib/src/event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkgs/unified_analytics/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions pkgs/unified_analytics/test/event_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down