Experiment preference changed unexpectedly at shutdown

NEW
Unassigned

Status

Webtools
Telemetry Server
8 months ago
8 months ago

People

(Reporter: ashughes, Unassigned)

Tracking

Trunk

Firefox Tracking Flags

(Not tracked)

Details

This bug originates from bug 1319206 comment 3. 

While testing my Telemetry experiment I discovered that when a user was put into a test group (ie. preference changed) upon restart they would be put into the user-changed group because the preference was being reset during restart. I traced this to the shutdown() function in bootstrap.js.

The original code is as follows:
> function shutdown(reason) {
>  if (reason != APP_SHUTDOWN) {
>    // when the add-on is being disabled/uninstalled
>    prefs.reset("name.of.preference");
>  }
> }  

My understanding is that this code should not be hit when I quit Firefox but on my Windows 10 machine it was. To work around this issue I amended the code to be the following:

> function shutdown(reason) {
>  if (reason == ADDON_DISABLE || reason == ADDON_UNINSTALL) {
>    // when the add-on is being disabled/uninstalled
>    prefs.reset("name.of.preference");
>  }
> } 

So now the preference only gets reset when the addon is disabled or uninstalled, which is the original intent of this code (as far as I understand it).

I am not sure if this impacts any other experiments but I am filing this bug at Felipe Gomes' request.
You need to log in before you can comment on or make changes to this bug.