Closed Bug 1494413 Opened 7 years ago Closed 7 years ago

Firefox studies can't be enabled

Categories

(Firefox :: Settings UI, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: soeren.hentzschel, Unassigned)

Details

(Keywords: nightly-community)

Attachments

(1 file)

Attached image screenshot
I can't enable Firefox studies in the preferences. After checking the checkbox (the second checkbox in the attached screenshot) and reloading the preferences the checkbox is unchecked again. It also happens in the Firefox safe mode but only with my productive used Firefox profile - I can't reproduce with a new profile. But still, I guess this should always work. So maybe there is a bug somewhere. Let me know if there is anything I can do to help finding the cause.
That checkbox should be associated with the app.shield.optoutstudies.enabled pref in about:config. If you open about:config in a separate tab, can you confirm that checking that box does not cause about:config to update app.shield.optoutstudies.enabled to true?
Flags: needinfo?(soeren.hentzschel)
That's really interesting. The option app.shield.optoutstudies.enabled is always *true* and not false. It sounds like true means "studies are enabled", while the visible preferences say the opposite. And also the about:studies shows the text for disabled studies and not the text for enabled studies in the grey box. Checking and unchecking the checkbox does not change app.shield.optoutstudies.enabled. Changing the value of app.shield.optoutstudies.enabled to false in about:config and then checking and unchecking the checkbox does also not change app.shield.optoutstudies.enabled.
Flags: needinfo?(soeren.hentzschel)
Hey jkt, I think you've worked on the SHIELD toggle ... any idea what might be happening here?
Flags: needinfo?(jkt)
So there are a few things that control this checkbox: const isDisabled = ( !allowedByPolicy || Services.prefs.prefIsLocked(PREF_OPT_OUT_STUDIES_ENABLED) || !Services.prefs.getBoolPref(PREF_UPLOAD_ENABLED, false) ); Where: PREF_OPT_OUT_STUDIES_ENABLED = "app.shield.optoutstudies.enabled" PREF_UPLOAD_ENABLED = "datareporting.healthreport.uploadEnabled" allowedByPolicy = Services.policies.isAllowed("Shield") It might be that we aren't disabling the checkbox correctly for example when an enterprise policy is disabling the functionality. The code is here: https://searchfox.org/mozilla-central/source/browser/components/preferences/in-content/privacy.js#1974 as you can see there are many states trying to roll into one, it's likely surrounding an edge case with these. The comment on line 1940 describes what the logic should be.
Flags: needinfo?(jkt)
Thanks for the pointer to browser/components/preferences/in-content/privacy.js. The isDisabled code is not the relevant code because the checkbox is not disabled. The checkbox is enabled but always unchecked. But a few line above there is the logic for checkboxMatchesPref which seems to be relevant. I compiled a local build, removed the MOZ_TELEMETRY_REPORTING checks, added some logging and tested with my "broken" profile. The logic is: ``` const checkboxMatchesPref = ( allowedByPolicy && Services.prefs.getBoolPref(PREF_UPLOAD_ENABLED, false) && Services.prefs.getBoolPref(PREF_NORMANDY_ENABLED, false) ); ``` The results: allowedByPolicy is: true Services.prefs.getBoolPref(PREF_UPLOAD_ENABLED, false) is: true Services.prefs.getBoolPref(PREF_NORMANDY_ENABLED, false) is: false => checkboxMatchesPref is: false And because of the following code the checkbox is always unchecked: ``` if (checkboxMatchesPref) { … } else { checkbox.removeAttribute("preference"); checkbox.removeAttribute("checked"); } ``` So I checked the value of PREF_NORMANDY_ENABLED (app.normandy.enabled) and app.normandy.enabled was set to false. I changed app.normandy.enabled to true and now it works again. I have no idea at all why app.normandy.enabled was set to false. I don't know if it my fault that app.normandy.enabled was set to false or if a change of Firefox caused this but since I don't know of similar reports and it works now I will close this ticket as WORKSFORME.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → WORKSFORME
> I have no idea at all why app.normandy.enabled was set to false. For the record: app.normandy.enabled is always false after intalling the Normandy Devtools Add-on: https://github.com/mozilla/normandy-devtools That's why I had the problem.
Okay, thanks Soren! I guess this is kinda expected then. I'll close this as INVALID for now.
Resolution: WORKSFORME → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: