Skip to content

Commit

Permalink
Clear experimenter id on telemetry disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
brizental committed Jan 17, 2024
1 parent ebb474f commit 2deb52e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/glean/mzglean.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,26 @@ void MZGlean::setUploadEnabled(bool isTelemetryEnabled) {

broadcastUploadEnabledChange(isTelemetryEnabled);

#if defined(MZ_ANDROID) || defined(MZ_IOS)
if (isTelemetryEnabled) {
#if defined(MZ_ANDROID) || defined(MZ_IOS)
// need to reset installation ID, as it would have been cleared
QString uuid = mozilla::glean::session::installation_id.generateAndSet();
SettingsHolder::instance()->setInstallationId(uuid);
#endif
} else {
// clear out the former installation ID immediately
// Note: Identifiers should be rotated when telemetry is disabled.
//
// Whenever telemetry is disabled, that generates a data deletion request
// on the backend. If telemtry is re-enabled, all new identifiers are
// generated by Glean, so we also rotate our identifiers to comply.

// Clear out the experimentation ID
SettingsHolder::instance()->removeUnauthedExperimenterId();
#if defined(MZ_ANDROID) || defined(MZ_IOS)
// Clear out the former installation ID
SettingsHolder::instance()->removeInstallationId();
}
#endif
}
}

// static
Expand Down

0 comments on commit 2deb52e

Please sign in to comment.