-
Notifications
You must be signed in to change notification settings - Fork 51
Clear contents of persisted files on opt out #87
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
Clear contents of persisted files on opt out #87
Conversation
@jcollins-g this is the second PR that is required by the PDD to clear the files on opt out – I have landed the previous one that removed the pddFlag already |
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.
Assuming that there's a good reason for leaving empty files on the disk, lgtm.
if (!reportingBool) { | ||
_sessionHandler.sessionFile.writeAsStringSync(''); | ||
_logHandler.logFile.writeAsStringSync(''); | ||
_clientIdFile.writeAsStringSync(''); |
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 would have assumed that the files would be deleted from disk, not just emptied. Is there a reason for leaving an empty file on disk?
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.
We asked to have it be cleared because I didn't want to change the initializer logic, on startup, the Initializer
class checks to make sure each of these files exist, if not, it will create them. And this happens before we determine if the user has opted out so it would be a lot more refactoring
When the user opts out of telemetry collection, we will clear the contents of the following files:
CLIENT_ID
dart-flutter-telemetry.log
dart-flutter-session.json
If the user chooses to opt back into telemetry collection, these files will be regenerated:
CLIENT_ID
– a new client id will be regenerateddart-flutter-telemetry.log
– events will begin to get persisted locally again as they are sentdart-flutter-session.json
– the json object containing thesession_id
andlast_ping
will be regeneratedReference issue: #84