-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Update runner to handle logic for both analytics packages #124606
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nit: Splitting the logic from here down to 309 may help with readability and testability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--disable-telemetry is only for a single run, right? I think we should clarify this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.