Skip to content

Commit 25d77e1

Browse files
authored
Re-land "[unified_analytics] Send enabled_features as an event parameter rather than a user property (#2007)" (#2066)
1 parent 8d49319 commit 25d77e1

File tree

8 files changed

+368
-274
lines changed

8 files changed

+368
-274
lines changed

pkgs/unified_analytics/CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 8.0.0
2+
- Send `enabled_features` as an event parameter in all events rather than as a user property.
3+
14
## 7.0.2
25
- Allow `LogStatsFile` to contain more granular event types (specifically `property_editor` events).
36

pkgs/unified_analytics/lib/src/analytics.dart

+6-1
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ class AnalyticsImpl implements Analytics {
339339
final File _clientIdFile;
340340
final UserProperty _userProperty;
341341
final LogHandler _logHandler;
342+
final String? _enabledFeatures;
342343

343344
/// Tells the client if they need to show a message to the
344345
/// user; this will return true if it is the first time the
@@ -406,8 +407,8 @@ class AnalyticsImpl implements Analytics {
406407
truncateStringToLength(io.Platform.operatingSystemVersion, 36),
407408
locale: io.Platform.localeName,
408409
clientIde: clientIde,
409-
enabledFeatures: enabledFeatures,
410410
),
411+
_enabledFeatures = enabledFeatures,
411412
_configHandler = ConfigHandler(
412413
homeDirectory: homeDirectory,
413414
configFile: homeDirectory
@@ -613,6 +614,7 @@ class AnalyticsImpl implements Analytics {
613614
eventName: event.eventName,
614615
eventData: event.eventData,
615616
userProperty: _userProperty,
617+
enabledFeatures: _enabledFeatures,
616618
);
617619

618620
if (_enableAsserts) checkBody(body);
@@ -654,6 +656,7 @@ class AnalyticsImpl implements Analytics {
654656
eventName: collectionEvent.eventName,
655657
eventData: collectionEvent.eventData,
656658
userProperty: _userProperty,
659+
enabledFeatures: _enabledFeatures,
657660
);
658661

659662
_logHandler.save(data: body);
@@ -664,6 +667,7 @@ class AnalyticsImpl implements Analytics {
664667
clientId: clientId,
665668
eventName: collectionEvent.eventName,
666669
eventData: collectionEvent.eventData,
670+
enabledFeatures: _enabledFeatures,
667671
userProperty: _userProperty,
668672
);
669673

@@ -774,6 +778,7 @@ class FakeAnalytics extends AnalyticsImpl {
774778
eventName: event.eventName,
775779
eventData: event.eventData,
776780
userProperty: _userProperty,
781+
enabledFeatures: _enabledFeatures,
777782
);
778783

779784
if (_enableAsserts) checkBody(body);

pkgs/unified_analytics/lib/src/constants.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -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.2';
90+
const String kPackageVersion = '8.0.0';
9191

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

0 commit comments

Comments
 (0)