Closed Bug 1309384 Opened 8 years ago Closed 8 years ago

prefs shim should merge in prefs defaults at startup

Categories

(DevTools :: Framework, enhancement, P1)

enhancement

Tracking

(firefox52 fixed)

RESOLVED FIXED
Firefox 52
Iteration:
52.2 - Oct 17
Tracking Status
firefox52 --- fixed

People

(Reporter: tromey, Assigned: tromey)

References

Details

(Whiteboard: [devtools-html])

Attachments

(2 files, 1 obsolete file)

The prefs shim should either merge in defaults at startup or it should write everything out. (But probably merging is best.) See https://bugzilla.mozilla.org/show_bug.cgi?id=1291049#c63
Iteration: --- → 52.2 - Oct 17
Flags: qe-verify-
Priority: -- → P1
Whiteboard: [devtools-html] → [reserve-html]
Thanks for filing Tom! (In reply to Tom Tromey :tromey from comment #0) > The prefs shim should either merge in defaults at startup or it > should write everything out. (But probably merging is best.) I agree, merging would be the best here. This way if a default value changes and has not been overridden by the user, the new default value will be used.
Wow, I really don't know what I was thinking in this code. The startup stuff all seems backward.
Comment on attachment 8801146 [details] Bug 1309384 - merge default and user prefs in Services shim; https://reviewboard.mozilla.org/r/85918/#review84586 Great patch, thanks for fixing this! Just two nits. (For the record I tested your patch with the inspector webpack bundle and it fixes the startup issue) ::: devtools/client/shared/shim/Services.js:363 (Diff revision 1) > * @param {Any} userValue the user value to use if the pref does not exist > * @param {Any} defaultValue the default value to use if the pref > * does not exist > * @param {Boolean} hasUserValue if a new pref is created, whether > * the default value is also a user value > + * @param {Boolean} init if true, then this call is initialization nit: The two previous arguments are swapped in the jsdoc, would be nice to fix it here. ::: devtools/client/shared/shim/test/test_service_prefs_defaults.html:67 (Diff revision 1) > + > + SimpleTest.finish(); > +} > + > +SimpleTest.waitForExplicitFinish(); > +do_tests(); nit: Since the test is synchronous I think you can get rid of SimpleTest.finish(), SimpleTest.waitForExplicitFinish() as well as the "do_tests" wrapper.
Attachment #8801146 - Flags: review?(jdescottes) → review+
Blocks: devtools-html-phase2
No longer blocks: devtools-html-3
Whiteboard: [reserve-html] → [devtools-html]
Tom: I pushed https://bugzilla.mozilla.org/attachment.cgi?id=8801183 here so that I don't forget. While testing your patch I realized the preferences where still not saved when reloading the inspector. Maybe it's best to address it in a separate bug? But if you want to integrate it and land it here, that works for me :)
Comment on attachment 8801183 [details] Bug 1309384 - fix override of default preference; https://reviewboard.mozilla.org/r/85926/#review84618 Thanks, this looks good.
Attachment #8801183 - Flags: review?(ttromey) → review+
Comment on attachment 8801227 [details] Bug 1309384 - fix override of default preference; https://reviewboard.mozilla.org/r/85940/#review84620 I already r+d the other one, this is just fixing it after the changes requested to the first patch.
Attachment #8801227 - Flags: review?(ttromey) → review+
Comment on attachment 8801183 [details] Bug 1309384 - fix override of default preference; I would have thought that mozreview would do this automatically.
Attachment #8801183 - Attachment is obsolete: true
Pushed by ttromey@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d61c25d687c4 merge default and user prefs in Services shim; r=jdescottes https://hg.mozilla.org/integration/autoland/rev/ce7b9aa047e8 fix override of default preference;r=tromey
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 52
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: