Closed Bug 1408099 Opened 7 years ago Closed 7 years ago

browserSettings.homepageOverride.get throws an exception if the home page has never been overridden

Categories

(WebExtensions :: General, defect, P1)

defect

Tracking

(firefox57 wontfix, firefox58 fixed)

RESOLVED FIXED
mozilla58
Tracking Status
firefox57 --- wontfix
firefox58 --- fixed

People

(Reporter: bsilverberg, Assigned: bsilverberg)

References

Details

Attachments

(1 file)

There's a bug in the code for getLevelOfControl in the ExtensionPreferencesManager (EPM) that will throw an exception if it is called before a corresponding setting has been added to the EPM.

In the case of browserSettings.homepageOverride, an extension could call this method, but if no installed extensions ever touched the home page via chrome_settings_overrides.homepage, then the EPM won't know about the setting and it will throw an exception.

This is a simple fix to the getLevelOfControl function in the EPM, although based on a separate conversation in IRC it sounds like we might be able to entirely remove the getLevelOfControl function from the EPM as it's only there to support reporting about locked prefs, which I think we have decided we do not want to support.

This needs to be fixed, regardless of the implementation.
The feature containing this bug landed in 57. I'm not sure how critical a bug this is, and whether a fix qualifies for uplift, so flagging it for tracking 57.
Assignee: nobody → bob.silverberg
Bob: Who would be a good person to assess the criticality? Also if it just throws an exception it sounds like something we could live with for 57.
Flags: needinfo?(bob.silverberg)
(In reply to Marcia Knous [:marcia - use ni] from comment #4)
> Bob: Who would be a good person to assess the criticality? Also if it just
> throws an exception it sounds like something we could live with for 57.

I think andym would be the person to decide. If we do not fix this then one particular API, browserSettings.homepageOverride.get() will throw an exception rather than returning the expected information, in certain situations. It doesn't seem that critical to me, but I wanted to raise it for someone to assess.
Flags: needinfo?(bob.silverberg) → needinfo?(amckay)
Agree with Bob. This is a new API. I'd be surprised if there are any developers using it, and if they do they can catch the error. Let's not uplift.
Flags: needinfo?(amckay)
Comment on attachment 8918011 [details]
Bug 1408099 - Fix ExtensionPreferencesManager.getLevelOfControl to deal with undefined settings,

https://reviewboard.mozilla.org/r/188892/#review194602
Attachment #8918011 - Flags: review?(aswan) → review+
Pushed by bsilverberg@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/247bb54b615f
Fix ExtensionPreferencesManager.getLevelOfControl to deal with undefined settings, r=aswan
https://hg.mozilla.org/mozilla-central/rev/247bb54b615f
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
If wontfix in 57, The following compatibility should be changed.
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/browserSettings/homepageOverride
Is manual testing required on this bug? If Yes, please provide some STR and the proper webextension(if required), if No set the “qe-verify-“ flag.
Flags: needinfo?(bob.silverberg)
Flags: needinfo?(bob.silverberg) → qe-verify-
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: