Skip to content

Commit

Permalink
Add more parameters (androidAppId and iosBundleId) in devtools events. (
Browse files Browse the repository at this point in the history
#295)

Co-authored-by: Andrew Kolos <[email protected]>
  • Loading branch information
hannah-hyj and andrewkolos authored Oct 2, 2024
1 parent e5b699f commit d4995d4
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pkgs/unified_analytics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## 6.1.4-wip
## 6.1.4

- Fix formatting and remove dependency on `package:intl`.
- Remove direct usage of `package:path` in favor of `package:file`.
- Added `androidAppId` and `iosBundleId` to the `Event.devtoolsEvent` constructor.

## 6.1.3

Expand Down
2 changes: 1 addition & 1 deletion pkgs/unified_analytics/lib/src/constants.dart
Original file line number Diff line number Diff line change
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 = '6.1.4-wip';
const String kPackageVersion = '6.1.4';

/// The minimum length for a session.
const int kSessionDurationMinutes = 30;
Expand Down
7 changes: 7 additions & 0 deletions pkgs/unified_analytics/lib/src/event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,10 @@ final class Event {
int? rootSetCount,
int? rowCount,
int? inspectorTreeControllerId,

// DeepLinkScreenMetrics
String? androidAppId,
String? iosBundleId,
}) : eventName = DashEvent.devtoolsEvent,
eventData = {
'eventCategory': eventCategory,
Expand Down Expand Up @@ -446,6 +450,9 @@ final class Event {
if (rowCount != null) 'rowCount': rowCount,
if (inspectorTreeControllerId != null)
'inspectorTreeControllerId': inspectorTreeControllerId,
// DeepLinkScreenMetrics
if (androidAppId != null) 'androidAppId': androidAppId,
if (iosBundleId != null) 'iosBundleId': iosBundleId,
};

/// Event that contains the results for a specific doctor validator.
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: 6.1.4-wip
version: 6.1.4
# LINT.ThenChange(lib/src/constants.dart)
repository: https://github.com/dart-lang/tools/tree/main/pkgs/unified_analytics

Expand Down
6 changes: 5 additions & 1 deletion pkgs/unified_analytics/test/event_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,8 @@ void main() {
rootSetCount: 123,
rowCount: 123,
inspectorTreeControllerId: 123,
androidAppId: 'androidAppId',
iosBundleId: 'iosBundleId',
);

final constructedEvent = generateEvent();
Expand Down Expand Up @@ -622,7 +624,9 @@ void main() {
expect(constructedEvent.eventData['rootSetCount'], 123);
expect(constructedEvent.eventData['rowCount'], 123);
expect(constructedEvent.eventData['inspectorTreeControllerId'], 123);
expect(constructedEvent.eventData.length, 28);
expect(constructedEvent.eventData['androidAppId'], 'androidAppId');
expect(constructedEvent.eventData['iosBundleId'], 'iosBundleId');
expect(constructedEvent.eventData.length, 30);
});

test('Confirm all constructors were checked', () {
Expand Down

0 comments on commit d4995d4

Please sign in to comment.