Page MenuHomePhabricator

mw.loader callback fires from handlePending when module is still executing
Closed, ResolvedPublic

Description

  1. View https://no.wikipedia.org/w/index.php?title=MediaWiki:Gadget-notifications.js&action=edit
  2. Open web console

Exception in load-callback in module mediawiki.action.edit.styles:
TypeError: Cannot read property 'addButton' of undefined

[html-script]
window.RLQ.push(function() {
    mw.loader.using("mediawiki.toolbar", function() {
        mw.toolbar.addButton(false, "Bold text", "'''", "'''", "Bold text", "mw-editbutton-bold");
        ...

With this exception paused, the following evaluation can be run from the console:

mw.loader.moduleRegistry['mediawiki.toolbar']
Object { version: "RjcW87zo", dependencies: Array[0], group: null, source: "local", state: "executing"…}

Note state=executing. This should be impossible.

It appears to be triggered by the css callback from "mediawiki.action.edit.styles", which is is combined with the css callback from "mediawiki.toolbar" presumably. That in itself isn't a problem, but then it is somehow bypassing the mediawiki.toolbar module's runScript and handling the callbacks directly.

Event Timeline

Krinkle created this task.Sep 11 2015, 3:22 AM
Krinkle updated the task description. (Show Details)
Krinkle raised the priority of this task from to High.
Krinkle added subscribers: Krinkle, Catrope.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 11 2015, 3:22 AM
Krinkle updated the task description. (Show Details)Sep 11 2015, 3:22 AM
Krinkle set Security to None.
Krinkle updated the task description. (Show Details)

Change 237587 had a related patch set uploaded (by Krinkle):
resourceloader: Jobs created in request() should wait for executing modules

https://gerrit.wikimedia.org/r/237587

Krinkle claimed this task.Sep 11 2015, 6:30 AM
Krinkle moved this task from Inbox to Assigned on the MediaWiki-ResourceLoader board.
Krinkle moved this task from Inbox to Doing on the Performance-Team board.

Change 237697 had a related patch set uploaded (by Krinkle):
resourceloader: Jobs created in request() should wait for executing modules

https://gerrit.wikimedia.org/r/237697

Change 237697 merged by jenkins-bot:
resourceloader: Jobs created in request() should wait for executing modules

https://gerrit.wikimedia.org/r/237697

Change 237587 merged by jenkins-bot:
resourceloader: Jobs created in request() should wait for executing modules

https://gerrit.wikimedia.org/r/237587