Page MenuHomePhabricator

Historical visual diff throwing uncaught exception
Closed, ResolvedPublic1 Estimated Story Points

Description

Earlier today I wanted to test the "&visualdiff" trick on a page.
It worked on most pages except for this diff, as nothing happens when I click on Visual (beta). If I click on Wikitext, and then on Visual (beta) again to give it another try, it actually triggers another progress bar (but again no visual diff). I stopped at the 5th bar despite it being a mesmerizing sight (F9999758). It's the same on different browsers, FWIW.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Other diff that also fails with the same error message: https://de.wikipedia.org/w/index.php?title=Lex&diff=prev&oldid=169798942&visualdiff&diffmode=visual

jQuery.Deferred exception: oldDocChildTree.orderedNodes[treeDiff[i][0]] is undefined ve.dm.VisualDiff.prototype.getDocChildDiff@https://en.wikipedia.org/w/load.php?debug=false&lang=en&modules=diffMatchPatch%2Cmoment%2Cpapaparse%2Crangefix%2Cspark-md5%2CtreeDiffer%2Cunicodejs%7Cext.CodeMirror.data%2Clib%2CvisualEditor%7Cext.CodeMirror.mode.mediawiki%7Cext.CodeMirror.visualEditor.init%7Cext.cite.style%2CvisualEditor%7Cext.cite.visualEditor.core%2Cdata%7Cext.citoid.visualEditor%7Cext.citoid.visualEditor.data%7Cext.disambiguator.visualEditor%7Cext.geshi.visualEditor%7Cext.graph.data%2CvisualEditor%7Cext.kartographer%2CtemplateData%7Cext.kartographer.editing%2CvisualEditor%7Cext.math.styles%2CvisualEditor%7Cext.score.visualEditor%7Cext.templateData.images%7Cext.templateDataGenerator.data%2CeditPage%2Cui%7Cext.templateDataGenerator.ui.images%7Cext.visualEditor.articleTarget%2Cbase%2Ccore%2Cdata%2CdesktopArticleTarget%2CdesktopTarget%2Cdiffing%2Cicons%2Clanguage%2Cmediawiki%2CmoduleIcons%2Cmwalienextension%2Cmwcore%2Cmwdiffing%2Cmwextensionmessages%2Cmwextensions%2Cmwformatti[…] undefined
Esanders renamed this task from Can trigger multiple progress bars to show up, but won't get a visual diff to Historical visual diff throwing uncaught exception.Oct 9 2017, 10:29 AM

Exception is on line 458 of ve.dm.VisualDiff:

oldNode = oldDocChildTree.orderedNodes[ treeDiff[ i ][ 0 ] ].node;

treeDiff[ i ] appears to contain integers (for all values of i), so this is undefined. The check on the line above is treeDiff[ i ][ 0 ] !== null so it passes this.

Deskana moved this task from To Triage to TR6: Visual diffs on the VisualEditor board.

Looks like it's because these are timing out at the tree diff stage, because of the long bullet lists. We should do two things:

  • Handle lists better (the generic solution takes too long when lists are too long or too many)
  • Handle timeouts better

Change 385831 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[VisualEditor/VisualEditor@master] Fix visual diff timeout

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

Deskana set the point value for this task to 1.

Change 385831 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Fix visual diff timeout

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

Change 391137 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (d9059cd50)

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