Page MenuHomePhabricator

mw.loader.using shouldn't call callback more than once
Closed, ResolvedPublic

Description

When running CentralNotice on trunk with debug=true, I usually get the banner repeated several times at the top of the page (as many as 5 times). The BannerController and BannerListLoader are only loaded once, but the BannerLoader gets loaded several times. I've only noticed this behavior after my last svn update, so it is likely due to a recent change.


Version: 1.20.x
Severity: major

Details

Reference
bz34696

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:13 AM
bzimport set Reference to bz34696.

I've isolated the bug. The following command only gets executed once...
mw.loader.using( 'mediawiki.user', function() { ...blah... } );
... yet the anonymous callback function (...blah...) gets executed multiple times.

I wonder if similar problems could be causing bug 34664

(In reply to comment #0)

When running CentralNotice on trunk with debug=true,

Since you say this is trunk, changing the version.

Just saw this happen without debug=true on test.wikipedia.org. Raising severity.

Roan said this was related to work that he and Krinkle recently did on ResourceLoader, and he has a solution for it.

Also, this may be unique to Firefox.

Assigning to Roan per comment 4

Created attachment 10195
Patch to fix callback bug

Attached:

Patch (based on Roan's analysis) committed in r113617. If anything else is needed, please reopen.