Page MenuHomePhabricator

Errors in mw-client-NEW-errors TypeError: Cannot read properties of undefined (reading 'Keys')
Closed, ResolvedPublicBUG REPORT

Description

Stack Trace

at HTMLAnchorElement.phonosClickHandler  https://en.m.wikipedia.org/w/load.php?lang=en&modules=ext.centralNotice.choiceData%2Cdisplay%2CgeoIP%2CimpressionDiet%2CkvStore%2ClegacySupport%2CstartUp%7Cext.centralauth.ForeignApi%2Ccentralautologin%7Cext.checkUser.clientHints%7Cext.cite.ux-enhancements%7Cext.cx.entrypoints.languagesearcher.init%7Cext.cx.entrypoints.mffrequentlanguages%7Cext.cx.eventlogging.campaigns%7Cext.cx.model%7Cext.echo.centralauth%7Cext.eventLogging%2CnavigationTiming%2Cpopups%2CwikimediaEvents%7Cext.growthExperiments.SuggestedEditSession%7Cext.phonos.init%7Cext.relatedArticles.readMore.bootstrap%7Cext.urlShortener.toolbar%7Cjquery%2Coojs%2Csite%7Cjquery.client%7Cmediawiki.ForeignApi%2CString%2CTitle%2CUri%2Capi%2Cbase%2Ccldr%2Ccookie%2Cexperiments%2CjqueryMsg%2Clanguage%2Crouter%2Cstorage%2Ctemplate%2Cuser%2Cutil%2CvisibleTimeout%7Cmediawiki.ForeignApi.core%7Cmediawiki.libs.pluralruleparser%7Cmediawiki.page.media%2Cready%7Cmediawiki.page.watch.ajax%7Cmediawiki.template.mustache%7Cmobile.init%2Cstartup%7Cmobile.ooui.icons%7Cmobile.pagelist.styles%7Cmobile.pagesummary.styles%7Cmobile.placeholder.images%7Cmobile.startup.images%7Cmw.cx.SiteMapper%7Cmw.externalguidance.init%7Cskins.minerva.icons.images.scripts.misc%7Cskins.minerva.icons.page.issues.default.color%7Cskins.minerva.icons.page.issues.medium.color%7Cskins.minerva.icons.page.issues.uncolored%7Cskins.minerva.messageBox.styles%7Cskins.minerva.scripts&skin=minerva&version=p7wcv:192:262

File Url

https://en.m.wikipedia.org/w/load.php?lang=en&modules=ext.centralNotice.choiceData%2Cdisplay%2CgeoIP%2CimpressionDiet%2CkvStore%2ClegacySupport%2CstartUp%7Cext.centralauth.ForeignApi%2Ccentralautologin%7Cext.checkUser.clientHints%7Cext.cite.ux-enhancements%7Cext.cx.entrypoints.languagesearcher.init%7Cext.cx.entrypoints.mffrequentlanguages%7Cext.cx.eventlogging.campaigns%7Cext.cx.model%7Cext.echo.centralauth%7Cext.eventLogging%2CnavigationTiming%2Cpopups%2CwikimediaEvents%7Cext.growthExperiments.SuggestedEditSession%7Cext.phonos.init%7Cext.relatedArticles.readMore.bootstrap%7Cext.urlShortener.toolbar%7Cjquery%2Coojs%2Csite%7Cjquery.client%7Cmediawiki.ForeignApi%2CString%2CTitle%2CUri%2Capi%2Cbase%2Ccldr%2Ccookie%2Cexperiments%2CjqueryMsg%2Clanguage%2Crouter%2Cstorage%2Ctemplate%2Cuser%2Cutil%2CvisibleTimeout%7Cmediawiki.ForeignApi.core%7Cmediawiki.libs.pluralruleparser%7Cmediawiki.page.media%2Cready%7Cmediawiki.page.watch.ajax%7Cmediawiki.template.mustache%7Cmobile.init%2Cstartup%7Cmobile.ooui.icons%7Cmobile.pagelist.styles%7Cmobile.pagesummary.styles%7Cmobile.placeholder.images%7Cmobile.startup.images%7Cmw.cx.SiteMapper%7Cmw.externalguidance.init%7Cskins.minerva.icons.images.scripts.misc%7Cskins.minerva.icons.page.issues.default.color%7Cskins.minerva.icons.page.issues.medium.color%7Cskins.minerva.icons.page.issues.uncolored%7Cskins.minerva.messageBox.styles%7Cskins.minerva.scripts&skin=minerva&version=p7wcv

Error count

1,168

Logstash Url

https://logstash.wikimedia.org/app/dashboards#/view/AXDBY8Qhh3Uj6x1zCF56?_g=h@d942f56&_a=h@09cc74a

Event Timeline

Mo will add error rate and link to logstash.

Mo will add error rate and link to logstash.

Done

TypeError: Cannot read properties of undefined (reading 'Keys') introduced by OO.ui.Keys.ENTER (1af2997)? I can't replicate this though..

Related: rEPHN1af2997bad71: Trigger button on enter as well as click, T347056: Unable to activate Phonos button with keyboard when it has an error

I guess this happens on a page where no OOUI is used elsewhere? i.e. we're trying to avoid using OOUI before the click, but then to determine the click we're using it! Oops. (My mistake, I think.) We can probably just use the key's codes directly (or maybe via variables for easier reading).

Change 973387 had a related patch set uploaded (by Fomafix; author: Fomafix):

[mediawiki/extensions/Phonos@master] Use static integers instead of OO.ui.Keys

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

modules/ext.phonos.init.js uses OO.ui.Keys. OO.ui.Keys is defined in module oojs-ui-core. In extension.json there is no dependency on this module. Therefor error can happen if the module in not loaded yet.

oojs-ui-core is a very large module. A dependency requires to load this large module just for the small static values:

OO.ui.Keys.ENTER = 13;
OO.ui.Keys.SPACE = 32;

I suggest to use the static integers instead of adding a dependency on module oojs-ui-core. I created I10c7fd827be559ba8dcdec01c38ee6ace63922aa (https://gerrit.wikimedia.org/r/973387) for this.

Change 973387 merged by jenkins-bot:

[mediawiki/extensions/Phonos@master] Use static integers instead of OO.ui.Keys

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

TheDJ subscribed.

The issue has dropped from logstash. Keeping ticket open so that the team can complete their own processes.

MusikAnimal assigned this task to Fomafix.
MusikAnimal subscribed.

Fomafix's approach seems perfect given the circumstances (we don't want to load OOUI on page load). Thank you for taking care of this!