Page MenuHomePhabricator

Uncaught TypeError: Cannot read property 'length' of null at Object.wordbreak.isBreak
Closed, ResolvedPublic

Description

at Object.wordbreak.isBreak  URL1:607:33
at Object.wordbreak.moveBreakOffset  URL1:605:829
at Object.wordbreak.prevBreakOffset  URL1:605:390
at VeDmElementLinearData.ve.dm.ElementLinearData.getWordRange  URL2:369:563
at VeCeSurface.ve.ce.Surface.maybeSetBreakpoint  URL2:555:172
at URL2:551:185

URL1: https://my.wikipedia.org/w/load.php?lang=my&modules=diffMatchPatch%2Cdompurify%2Cmoment%2Coojs-ui%2Coojs-ui-core%2Coojs-ui-toolbars%2Coojs-ui-widgets%2Coojs-ui-windows%2Cpapaparse%2Crangefix%2Cspark-md5%2CtreeDiffer%2Cunicodejs%7Cext.CodeMirror.visualEditor%7Cext.CodeMirror.visualEditor.init%7Cext.abuseFilter.visualEditor%7Cext.cite.style%2CvisualEditor%7Cext.cite.visualEditor.core%2Cdata%7Cext.citoid.visualEditor%7Cext.citoid.visualEditor.data%7Cext.confirmEdit.CaptchaInputWidget%2CvisualEditor%7Cext.disambiguator.visualEditor%7Cext.geshi.visualEditor%7Cext.graph.data%2CvisualEditor%7Cext.kartographer%7Cext.kartographer.editing%2Cutil%2CvisualEditor%7Cext.math.styles%2CvisualEditor%7Cext.score.visualEditor%7Cext.score.visualEditor.icons%7Cext.spamBlacklist.visualEditor%7Cext.templateDataGenerator.editPage%7Cext.titleblacklist.visualEditor%7Cext.visualEditor.data%2CmoduleIcons%2CmoduleIndicators%7Cext.wikihiero.visualEditor%7Cext.wikimediaEvents.visualEditor%7Cjquery.tablesorter%7Cjquery.tablesorter.styles%7Cmediawiki.ForeignStructuredUpload%2CForeignUpload%2CUpload%2Cpulsatingdot%2Cwidgets%7Cmediawiki.ForeignStructuredUpload.BookletLayout%7Cmediawiki.Upload.BookletLayout%7Cmediawiki.action.view.redirectPage%7Cmediawiki.diff.styles%7Cmediawiki.interface.helpers.styles%7Cmediawiki.language.months%2Cnames%7Cmediawiki.libs.jpegmeta%7Cmediawiki.page.gallery.styles%7Cmediawiki.skinning.content.parsoid%7Cmediawiki.widgets.AbandonEditDialog%2CCategoryMultiselectWidget%2CDateInputWidget%2CMediaSearch%2CStashedFileWidget%2CTable%2CUserInputWidget%2Cstyles%7Cmediawiki.widgets.DateInputWidget.styles%7Coojs-ui-core.icons%2Cstyles%7Coojs-ui-toolbars.icons%7Coojs-ui-widgets.icons%7Coojs-ui-windows.icons%7Coojs-ui.styles.icons-accessibility%2Cicons-content%2Cicons-editing-advanced%2Cicons-editing-citation%2Cicons-editing-core%2Cicons-editing-list%2Cicons-editing-styling%2Cicons-interactions%2Cicons-layout%2Cicons-location%2Cicons-media%2Cicons-moderation%2Cicons-movement%2Cicons-user%2Cicons-wikimedia%2Cindicators&skin=vector&version=y2qhz
URL2: https://my.wikipedia.org/w/load.php?lang=my&modules=ext.visualEditor.articleTarget%2Cbase%2Ccore%2CdesktopArticleTarget%2CdesktopTarget%2Cdiffing%2Cicons%2Clanguage%2Cmediawiki%2Cmwalienextension%2Cmwcore%2Cmwextensions%2Cmwformatting%2Cmwgallery%2Cmwimage%2Cmwlanguage%2Cmwlink%2Cmwmeta%2Cmwsave%2Cmwsignature%2Cmwtransclusion%2Csanitize%2Cswitching%2Cwelcome%7Cext.visualEditor.core.desktop%2Cutils%7Cext.visualEditor.mwextensions.desktop%7Cext.visualEditor.mwimage.core&skin=vector&version=11jjf

https://logstash.wikimedia.org/app/kibana#/doc/logstash-*/logstash-2020.10.07/clienterror/?id=AXUC_gZD1pGl6xFM9VLE
Happening with low frequency.

Event Timeline

Change 632957 had a related patch set uploaded (by Esanders; owner: Esanders):
[unicodejs@master] Use next/prevCodepoint for checking for sot/eot

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

Change 632957 merged by jenkins-bot:
[unicodejs@master] Use next/prevCodepoint for checking for sot/eot

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

matmarex added a subscriber: matmarex.

We've also already updated VisualEditor to use the latest version of the library in https://gerrit.wikimedia.org/r/c/VisualEditor/VisualEditor/+/632981.

Should be fixed by those patches.

Yeah, they look like the same problem.

ppelberg claimed this task.
matmarex added a subscriber: Esanders.

That is indeed the same error.

I'm not too familiar with this code, but looking at the previous patch (https://gerrit.wikimedia.org/r/c/unicodejs/+/632957), we added a check for nextCodepoint === null || prevCodepoint === null after the initial assignment to these variables. However, code below in that function can reassign them, and presumably one of those assignments results in null.

I'll leave this for @Esanders for now, hoping that the fix will be obvious to him.

ppelberg added a subscriber: ppelberg.

Change 681071 had a related patch set uploaded (by Esanders; author: Esanders):

[unicodejs@master] Always check prevCodepoint is non-null

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

Change 681071 merged by jenkins-bot:

[unicodejs@master] Always check prevCodepoint is non-null

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

Change 683666 had a related patch set uploaded (by Jforrester; author: Jforrester):

[VisualEditor/VisualEditor@master] Update UnicodeJS to v13.0.3

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

Change 683666 merged by jenkins-bot:

[VisualEditor/VisualEditor@master] Update UnicodeJS to v13.0.3

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

Change 683936 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (831a75cdb)

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

Change 683936 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (831a75cdb)

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

We should check the logs to confirm after this is deployed.

Krinkle assigned this task to matmarex.
Krinkle added a subscriber: Krinkle.

Checked for stack_trace:"Object.wordbreak.isBreak" on the medawiki-client-errors dashboard in Logstash over the past 90 days. The entries stopped on May 7th, which is the week after the above patch landed.