Page MenuHomePhabricator

VE startup crashes on [[mw:Manual:FAQ]], probably due to <languages /> tag
Closed, ResolvedPublic1 Estimated Story Points

Description

  1. Open VE on https://www.mediawiki.org/wiki/Manual:FAQ?veaction=edit
  2. JS error
Uncaught TypeError: Cannot read property 'extsrc' of null
    at VeCeMWAlienInlineExtensionNode.ve.ce.MWExtensionNode.generateContents (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin…:4), <anonymous>:269:244)
    at VeCeMWAlienInlineExtensionNode.ve.ce.GeneratedContentNode.forceUpdate (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:477)
    at VeCeMWAlienInlineExtensionNode.ve.ce.GeneratedContentNode.update (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:477)
    at VeCeMWAlienInlineExtensionNode.VeCeGeneratedContentNode (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:475)
    at VeCeMWAlienInlineExtensionNode.VeCeMWExtensionNode (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin…:4), <anonymous>:268:783)
    at VeCeMWAlienInlineExtensionNode.VeCeMWInlineExtensionNode (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin…:4), <anonymous>:270:897)
    at new VeCeMWAlienInlineExtensionNode (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin…:4), <anonymous>:328:283)
    at VeCeNodeFactory.oo.Factory.create (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin…:4), <anonymous>:169:554)
    at VeCeParagraphNode.ve.ce.BranchNode.onSplice (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:341)
    at VeCeParagraphNode.ve.ce.ContentBranchNode.onSplice (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:346)
    at VeCeParagraphNode.VeCeBranchNode (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:339)
    at VeCeParagraphNode.VeCeContentBranchNode (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:345)
    at new VeCeParagraphNode (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:490)
    at VeCeNodeFactory.oo.Factory.create (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin…:4), <anonymous>:169:554)
    at VeCeDocumentNode.ve.ce.BranchNode.onSplice (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:341)
    at VeCeDocumentNode.VeCeBranchNode (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:339)
    at new VeCeDocumentNode (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:486)
    at new VeCeDocument (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:329)
    at new VeCeSurface (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:378)
    at VeUiSurface.ve.ui.Surface.createView (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:526)
    at new VeUiSurface (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:523)
    at VeInitMwDesktopArticleTarget.ve.init.Target.createSurface (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin…:4), <anonymous>:147:31)
    at VeInitMwDesktopArticleTarget.ve.init.mw.Target.createSurface (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin…:4), <anonymous>:163:227)
    at VeInitMwDesktopArticleTarget.ve.init.mw.ArticleTarget.createSurface (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin…:4), <anonymous>:596:891)
    at VeInitMwDesktopArticleTarget.ve.init.Target.addSurface (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin…:4), <anonymous>:147:696)
    at eval (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin…:4), <anonymous>:164:651)

The problem seems to be because Parsoid outputs

<span typeof="mw:Extension/languages" about="#mwt258" data-mw="{&quot;name&quot;:&quot;languages&quot;,&quot;attrs&quot;:{},&quot;body&quot;:null}" id="mwAg">
</span>

for the wikitext <languages /> at the top of the page. It appears that .body being null in the JSON blob causes this crash, because the code in ve.ce.MWExtensionNode#generateContents expects mwData.body.extsrc to exist. So maybe this is a Parsoid bug, but at the same time VE should probably be more resilient against this kind of thing.

Event Timeline

It would be nice if the spec was clearer on this: https://www.mediawiki.org/wiki/Specs/HTML/1.3.0 (Pinging @ssastry)

Change 356581 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] Guard against mwdata.body being null

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

Deskana triaged this task as Medium priority.
Deskana moved this task from To Triage to TR0: Interrupt on the VisualEditor board.

Change 356581 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Guard against mwdata.body being null

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

It would be nice if the spec was clearer on this: https://www.mediawiki.org/wiki/Specs/HTML/1.3.0 (Pinging @ssastry)

For some reason, I didn't get an email on this ping. I should check my email settings. But, there may be a regression here plus we need to fix docs as well.

Parsoid's output has been broken since March 1st because of
https://gerrit.wikimedia.org/r/#/c/339689/2/lib/wt2html/tt/ExtensionHandler.js

However, I suppose this probably got triggered in VE because of other VE changes and / or this has been broken since then but only caught now because this only affects pages with the <languages /> tag which is a small subset of VE-edited pages.