Page MenuHomePhabricator

JavaScript freeze/loop when editing or adding references
Closed, DuplicatePublic1 Estimate Story Points


In both these cases, one JavaScript cannot stop, the browser freezes and after some time Firefox displays a popup about a not responding JavaScript. When not clicking on "Stop", the saving animation (for case 2) continuous to run indefinitely.

  • case 1: Click on the "Reference" button. Freeze…
  • case 2: Edit a reference and click on "Save changes"

tested with Firefox 55 and 57, German wiki. (tested with:


Related Gerrit Patches:
mediawiki/extensions/Cite : masterDebounce reference list updates

Event Timeline

rugk created this task.Sep 16 2017, 9:57 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 16 2017, 9:57 PM
Deskana triaged this task as Unbreak Now! priority.Sep 18 2017, 10:17 AM
Deskana added a subscriber: Deskana.

This seems to be a performance problem somehow related to large articles on the German Wikipedia. I tried to reproduce with some large articles, and some random articles; all the large articles had this problem, and all the random articles (which tend to be smaller) did not.

I also tested in some large articles on the English Wikipedia, and could not reproduce this problem, although the reference box did seem a little bit slower than it should, so it seems like this is a more general performance problem that is affecting the German Wikipedia in a particularly disastrous fashion.

Large articles:


Random articles:

Restricted Application added subscribers: Liuxinyu970226, Jay8g, TerraCodes. · View Herald TranscriptSep 18 2017, 10:17 AM

The problem is they have started using the <references> tag again, which is a good thing because it means the ref list updates dynamically. Unfortunately the large wikis have been using {{references}} templates for so long that we haven't noticed the performance issues.

Change 378690 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/Cite@master] Debounce reference list updates

The above patch fixes the symptom if not the cause.

Pseudo-tested on by pasting the following monkey patch in the console:

ve.ce.MWReferencesListNode.prototype._update = ve.ce.MWReferencesListNode.prototype.update;
ve.ce.MWReferencesListNode.prototype.update = ve.debounce( ve.ce.MWReferencesListNode.prototype._update );
Esanders updated the task description. (Show Details)Sep 18 2017, 1:45 PM

Change 378690 merged by jenkins-bot:
[mediawiki/extensions/Cite@master] Debounce reference list updates

Esanders added a subscriber: dchan.Sep 18 2017, 2:33 PM

I think TreeModifier could be to blame, emitting more events than we used to and causing the list to rebuild many more times. Pinging @dchan .

Patch for this open Unbreak now! priority task has been merged two weeks ago.
What is left to do here?

Deskana lowered the priority of this task from Unbreak Now! to Medium.Oct 5 2017, 9:24 AM

The freezing problem is solved, but there's still other work to be done.

Deskana set the point value for this task to 1.Oct 12 2017, 1:26 PM

There's no patch to review here any more, but as I noted above, there's still other work to be done.

What remains here is essentially the same as T134975, so I'm going to merge them together.

Restricted Application removed a subscriber: Liuxinyu970226. · View Herald TranscriptOct 25 2017, 10:55 AM