Update runner to handle logic for both analytics packages#124606
Conversation
|
|
||
| Future<int> _exit(int code, {required ShutdownHooks shutdownHooks}) async { | ||
| // Prints the welcome message if needed. | ||
| final FirstRunMessenger messenger = |
There was a problem hiding this comment.
small nit: Splitting the logic from here down to 309 may help with readability and testability.
There was a problem hiding this comment.
That was my first approach but I realized that after running globals.flutterUsage.printWelcome(); which is below this line, the messenger's state for messenger.shouldDisplayLicenseTerms(); is changed after printing the welcome message.
So I was trying to grab the boolean before printing the message
| // If the user has opted out of legacy analytics, we will continue | ||
| // to opt them out of unified analytics and inform them | ||
| if (!legacyAnalyticsMessageShown && !globals.flutterUsage.enabled) { | ||
| await globals.analytics.setTelemetry(false); |
There was a problem hiding this comment.
I'm not sure what the best way to do this is, but ideally, new analytics should inherit the opt-out as close as possible to the tool starting up.
There was a problem hiding this comment.
Makes sense, moving it to the top of runZoned below the logic added for disabling telemetry
Co-authored-by: Zachary Anderson <[email protected]>
Co-authored-by: Zachary Anderson <[email protected]>
Co-authored-by: Zachary Anderson <[email protected]>
|
@zanderso this PR is ready for a final review, tests have been added to ensure that legacy opt out status is being passed to the new unified analytics |
| 'the flutter tool is migrating to a new analytics system. ' | ||
| 'Disabling analytics collection will disable both the legacy ' | ||
| 'and new analytics collection systems. ' | ||
| 'You can disable analytics reporting by running either `flutter --disable-telemetry` ' |
There was a problem hiding this comment.
--disable-telemetry is only for a single run, right? I think we should clarify this.
There was a problem hiding this comment.
No, flutter --disable-telemetry is the command for completely turning off telemetry for the new package. This message is a follow up to the original PDD consent message
I believe flutter --suppress-analytics is for the current run
…4606) Update runner to handle logic for both analytics packages
…4606) Update runner to handle logic for both analytics packages
Fixes: #124605
Handles both of the use cases mentioned in the issue
Example of what the output would look like for a developer just starting with Flutter today where both analytics reporting systems are enabled
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.