Page MenuHomePhabricator

Cannot change volume (Uncaught TypeError: Cannot read property 'addClass' of undefined)
Closed, ResolvedPublic

Description

In Chrome:

at $.<computed>.<computed>._mouseCapture  URL1:856:230
at $.<computed>.<computed>._mouseCapture  URL1:613:300
at $.<computed>.<computed>.mouseProto._touchStart  URL2:24:770
at HTMLDivElement.proxy  URL1:174:368
at HTMLDivElement.dispatch  URL1:101:742
at HTMLDivElement.elemData.handle  URL1:98:388

URL1: https://commons.wikimedia.org/w/load.php?lang=en&modules=dataValues.TimeValue%2Cvalues%7Cext.tmh.transcodetable%7Cext.uls.i18n%2Clanguagenames%2Cmediawiki%2Cmessages%7Cjquery%2Coojs-ui%2Coojs-ui-core%2Coojs-ui-toolbars%2Coojs-ui-widgets%2CvalueFormatters%2CvalueParsers%2Cvue%2Cwikibase%7Cjquery.animateWithEvent%2Ci18n%2Cinputautoexpand%2Cthrottle-debounce%2Ctipsy%2Cui%2Culs%2Cvalueview%7Cjquery.event.special.eachchange%7Cjquery.ui.commonssuggester%2Clanguagesuggester%2Csuggester%7Cjquery.uls.grid%7Cjquery.util.getDirectionality%7Cjquery.valueview.Expert%2CExpertExtender%2CExpertStore%7Cjquery.valueview.experts.CommonsMediaType%2CEmptyValue%2CGeoShape%2CGlobeCoordinateInput%2CMonolingualText%2CQuantityInput%2CStringValue%2CTabularData%2CTimeInput%2CUnDeserializableValue%7Cjquery.wikibase.entityselector%2Cwbtooltip%7Cmediawiki.action.edit.editWarning%7Cmediawiki.action.view.metadata%7Cmediawiki.confirmCloseWindow%7Cmediawiki.page.watch.ajax%7Cmw.TMHGalleryHook.js%7Cmw.config.values.wbDataTypes%2CwbRefTabsEnabled%2CwbRepo%2CwbSiteDetails%7Coojs-ui-toolbars.icons%7Coojs-ui.styles.icons-editing-core%2Cicons-interactions%2Cicons-location%2Cicons-movement%7Cutil.ContentLanguages%2CExtendable%2CMessageProvider%2CMessageProviders%2CNotifier%2ChighlightSubstring%7CvalueParsers.ValueParserStore%2Cparsers%7Cwikibase.EntityInitializer%2CSite%2CWikibaseContentLanguages%2CbuildErrorOutput%2CgetLanguageNameByCode%2CgetUserLanguages%2Cserialization%2Csites%2Ctainted-ref%2Ctemplates%7Cwikibase.api.ValueCaller%7Cwikibase.entityChangers.EntityChangersFactory%7Cwikibase.entityPage.entityLoaded%7Cwikibase.experts.Entity%2CItem%2CProperty%2C__namespace%2Cmodules%7Cwikibase.formatters.ApiValueFormatter%7Cwikibase.mediainfo.filePageDisplay%2Cstatements%2Culs%7Cwikibase.ui.entityViewInit%7Cwikibase.utilities.ClaimGuidGenerator%7Cwikibase.view.ControllerViewFactory%2CReadModeViewFactory%2C__namespace&skin=vector&version=fsjy7
URL2: https://commons.wikimedia.org/w/load.php?lang=en&modules=fullScreenApi%7Cjquery.debouncedresize%2CembedMenu%7Cjquery.ui.touchPunch%7Cmediawiki.UtilitiesTime%2CabsoluteUrl%2Cclient%7Cmediawiki.language.names%7Cmw.Api%2CEmbedPlayer%2CEmbedPlayerNative%2CEmbedTypes%2CMediaElement%2CMediaPlayer%2CMediaPlayers%2CMediaSource%2CMediaWikiPlayerSupport%2CTextSource%2CTimedText%2CajaxProxy&skin=vector&version=8o4mg

https://gerrit.wikimedia.org/g/mediawiki/extensions/TimedMediaHandler/+/d30d61623e525caebf136f0eb7b4c82e235a53f8/resources/mwembed/lib/jquery.ui.touchPunch.js#71

Event Timeline

This accounts for 9% of our client errors.

Change 628496 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/TimedMediaHandler@master] Drop jquery.ui.touchpunch

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

Change 628496 merged by jenkins-bot:
[mediawiki/extensions/TimedMediaHandler@master] Drop jquery.ui.touchpunch

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

Still occurring. Patch didn't fix it.
Possibly related to T261887 as that also happens when you drag volume controls (only in Firefox)

Jdlrobson renamed this task from Uncaught TypeError: Cannot read property 'addClass' of undefined to Cannot change volume (Uncaught TypeError: Cannot read property 'addClass' of undefined).Oct 20 2020, 5:51 PM
Jdlrobson updated the task description. (Show Details)

Investigating further it seems NaN is being passed to the slider function which is causing this issue $playHead.slider( 'value', val );
It's easily fixed. Patch coming.

Change 635353 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/TimedMediaHandler@master] If percent is undefined dont try to use it to change volume

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

I can't reproduce this on current git master following the directions in the original post. Can you provide an exact repro?

I can replicate it in Chrome OSX every time with steps up above. Hopefully i've done it slow enough to show how I do the 3 clicks and the drag.
Here's a gif that hopefully helps reinforce those steps. Let me know if you want to jump into a screen share session.

sr.gif (344×640 px, 1 MB)

Are you dragging the volume slider instead of the audio position slider? That might be doing it...

So if I manipulate the volume slider instead of the audio position slider, I can repro an error "Uncaught TypeError: closestHandle is undefined" but that's a different error than was reported?

Are you using Firefox? Note there are 2 errors types depending on which browser you use.

Yep, patch seems to fix it and the new version is nice and clean. :) +2!

Yeah I'm in firefox so that explains the exception diff :)

Change 635353 merged by jenkins-bot:
[mediawiki/extensions/TimedMediaHandler@master] mwEmbedPlayer: Don't try to use undefined value to change volume

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

I wanted to check this was fixed this week but because of the train deploy the fix won't go out until next week now.

I will take some time of next week but we should be able to confirm the fix for this task and T258422 (which I'm also hoping will be fixed) then.

Currently TMH is averaging 5,474 errors a day, and this fix should cut that in half.
This is how the graph currently looks we are expecting anything related to closestHandle to disapper.

Screen Shot 2020-11-06 at 9.48.31 AM.png (1×2 px, 328 KB)

If anyone is able to verify this fix in my absence on https://logstash.wikimedia.org/goto/b0674cbe12c704b7bc43993d371cabef and resolve this that would be great. Otherwise I'll take a look on my return!

Jdlrobson claimed this task.

This is fixed:

Screen Shot 2020-11-13 at 9.54.05 AM.png (834×2 px, 161 KB)