Closed Bug 1174234 Opened 8 years ago Closed 7 years ago

Mulet probably reads prefs in the wrong order


(Core :: Preferences: Backend, defect)

Gonk (Firefox OS)
Not set





(Reporter: kats, Unassigned)



The app.mozbuild file for mulet puts b2g/dev/app into the DIRS variable before the browser dir, which means the JS_PREFERENCE_FILES at [1] probably gets added first, followed by [2]. Most probably (haven't confirmed) this means that prefs from firefox.js will override the prefs from b2g.js and mulet.js which is kind of bad. One would expect mulet.js to override all other prefs files when building mulet. Somebody should confirm and fix if necessary.

So, I now think the build files don't matter too much...  the build system just copies each file to defaults/pref.  The load order is the more interesting part, as Fabrice suggested on IRC.

Today's mind bending Gecko code of the day:

"Load default pref files from a directory. The files in the directory are sorted reverse-alphabetically"[1]

So, this suggests the files are processed as:

* mulet.js
* firefox.js
* b2g.js

This is something that was dealt with in bug 1053185. Did it regressed?
Well I think mulet.js was added after bug 1053185. So the b2g.js might still take precedence over firefox.js, but mulet.js, which should beat them both, doesn't (which I still haven't actually confirmed, btw).
Maksim confirmed in bug 1166347 that firefox.js ends up overriding mulet.js for Mulet, which is a bad footgun. Moving this bug to Core::Preferences since it seems like we should allow specifying order in the API somehow.
Component: General → Preferences: Backend
Product: Firefox OS → Core
Hi Fabrice, do you have any ideas if we still need it for Connected Devices? Thanks!
Flags: needinfo?(fabrice)
(In reply to Hsin-Yi Tsai [:hsinyi] from comment #5)
> Hi Fabrice, do you have any ideas if we still need it for Connected Devices?
> Thanks!

Hi Hsin-Yi!
We still use Mulet for B2G OS, but as far as I know we have no issues with preferences.
Flags: needinfo?(fabrice)
Thanks Fabrice for the comment. I'll close is as WORKSFORME for now, but do feel free to reopen it if you see any issues.
Closed: 7 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.