- Mentioned In
- rMW545e40bae234: editWarning: Declare dependency on user.options
T104844: 'user.options' module loads in head, but 'user.defaults' loads at the bottom, which results in incorrect values existing in mw.user.options before 'user.defaults' executes (affects modules that don't specify correct dependencies)
rMW87a051dd0122: editWarning: Declare dependency on user.options
- Mentioned Here
- T104844: 'user.options' module loads in head, but 'user.defaults' loads at the bottom, which results in incorrect values existing in mw.user.options before 'user.defaults' executes (affects modules that don't specify correct dependencies)
I've tried but cannot reproduce.
Tested in linux with Firefox 38 and Chromium 37, logged-in and logged-out, on mw:Sandbox and en:WP:Sandbox
If I try to close the tab or the window, both give me the "Are you sure you want to leave?" browser warning.
If I log-in, and disable the userpreference for "Warn me when I leave an edit page with unsaved changes", then the browser warning is successfully disabled.
So what I'm actually seeing here, is that the mw.user.options.set with the defaults happens AFTER the mw.user.options.get for this option.
I suspect this behavior started occurring when we introduced user.defaults, it's actually the 2nd time that I have seen it now, though I don't remember where I saw it before... This is especially interesting, since the .get is inside a jQuery dom ready.
It seems that the defaults module is bottom loaded on demand by the loader, instead of top loaded as user.options is. If there is not a single module that depends on user.options, then the dependency of user.options on user.defaults is basically put last on the queue of RL (alphabetic ordering?), and user.defaults is loaded after any other bottom loaded module.
Now reported as: T104844