Bug 1966727 - Record BTP Nimbus exposure in MODE_ENABLED_DRY_RUN too. r=anti-tracking-reviewers,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D249636
This commit is contained in:
committed by
ezuehlcke@mozilla.com
parent
801a301e56
commit
3f2694f51e
@@ -1002,6 +1002,20 @@ BounceTrackingProtection::PurgeBounceTrackers() {
|
||||
}
|
||||
}
|
||||
|
||||
// Record exposure of the feature for Nimbus
|
||||
// experimentation.
|
||||
// The error result returned by this method isn't very
|
||||
// useful, so we ignore it. Thee method will also return
|
||||
// errors if the client is not enrolled in an experiment
|
||||
// involving BTP which we don't consider a failure state.
|
||||
//
|
||||
// We record exposure for MODE_ENABLED_DRY_RUN in addition to
|
||||
// MODE_ENABLED so we know in Nimbus when a client would have
|
||||
// been exposed to BTP had it been enabled. This enables us to
|
||||
// compare the control and treatment branches with exposure.
|
||||
Unused << NimbusFeatures::RecordExposureEvent(
|
||||
"bounceTrackingProtection"_ns, false);
|
||||
|
||||
if (StaticPrefs::privacy_bounceTrackingProtection_mode() ==
|
||||
nsIBounceTrackingProtection::MODE_ENABLED) {
|
||||
// Log successful purges.
|
||||
@@ -1021,15 +1035,6 @@ BounceTrackingProtection::PurgeBounceTrackers() {
|
||||
// Record successful purges via nsITrackingDBService for
|
||||
// tracker stats.
|
||||
ReportPurgedTrackersToAntiTrackingDB(purgedSites);
|
||||
|
||||
// Record exposure of the feature for Nimbus
|
||||
// experimentation.
|
||||
// The error result returned by this method isn't very
|
||||
// useful, so we ignore it. Thee method will also return
|
||||
// errors if the client is not enrolled in an experiment
|
||||
// involving BTP which we don't consider a failure state.
|
||||
Unused << NimbusFeatures::RecordExposureEvent(
|
||||
"bounceTrackingProtection"_ns, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ add_task(async function test_nimbus_exposure() {
|
||||
Services.fog.testResetFOG();
|
||||
});
|
||||
|
||||
add_task(async function test_nimbus_no_exposure_dry_run() {
|
||||
add_task(async function test_nimbus_exposure_dry_run() {
|
||||
Services.fog.testResetFOG();
|
||||
|
||||
Assert.equal(
|
||||
@@ -134,9 +134,14 @@ add_task(async function test_nimbus_no_exposure_dry_run() {
|
||||
|
||||
exposureEvents = Glean.normandy.exposeNimbusExperiment.testGetValue();
|
||||
Assert.equal(
|
||||
undefined,
|
||||
exposureEvents,
|
||||
"No Glean exposure events after BTP dry-run purge."
|
||||
1,
|
||||
exposureEvents?.length,
|
||||
"There should be one exposure event after BTP purged."
|
||||
);
|
||||
Assert.equal(
|
||||
"bounceTrackingProtection",
|
||||
exposureEvents[0].extra.featureId,
|
||||
"Feature ID matches BTP."
|
||||
);
|
||||
|
||||
await doExperimentCleanup();
|
||||
|
||||
Reference in New Issue
Block a user