Page MenuHomePhabricator

Uncaught TypeError: activeInstances[i].update is not a function
Closed, ResolvedPublic

Description

Wikidata only issue impacting several IPs: https://logstash.wikimedia.org/app/dashboards#/doc/logstash-*/logstash-2021.02.11?id=Lu_NjncB3WpTGKOOmrqd

Code: https://gerrit.wikimedia.org/g/mediawiki/extensions/Wikibase/+/881b78a176a9898abf9bbbb1617c07d3f81dd0ff/view/resources/jquery/wikibase/jquery.wikibase.statementgrouplabelscroll.js#21

https://www.wikidata.org/w/load.php?lang=en&modules=dataValues%2Cjquery%2Coojs%2Coojs-router%2Coojs-ui%2Coojs-ui-core%2Coojs-ui-toolbars%2Coojs-ui-widgets%2Coojs-ui-windows%2Csite%2CvalueFormatters%2CvalueParsers%2Cvue%2Cwikibase%7CdataValues.DataValue%2CTimeValue%2Cvalues%7Cext.centralNotice.choiceData%2Cdisplay%2CgeoIP%2CimpressionDiet%2CkvStore%2CstartUp%7Cext.centralauth.ForeignApi%2Ccentralautologin%7Cext.citoid.wikibase.init%7Cext.eventLogging%2CnavigationTiming%2CwikimediaEvents%7Cext.uls.common%2Ccompactlinks%2Ci18n%2Cinterface%2Clanguagenames%2Cmediawiki%2Cmessages%2Cpreferences%2Cwebfonts%7Cext.wikimediaEvents.wikibase%7Cjquery.animateWithEvent%2Cclient%2Ccookie%2Ci18n%2Cinputautoexpand%2CmakeCollapsible%2Cspinner%2CtextSelection%2Cthrottle-debounce%2Ctipsy%2Cui%2Culs%2Cvalueview%7Cjquery.event.special.eachchange%7Cjquery.spinner.styles%7Cjquery.ui.commonssuggester%2Clanguagesuggester%2Csuggester%7Cjquery.uls.data%2Cgrid%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.ForeignApi%2CString%2CTitle%2CUri%2Capi%2Cbase%2Ccldr%2Ccookie%2Cexperiments%2CjqueryMsg%2Clanguage%2Cstorage%2Cuser%2Cutil%7Cmediawiki.ForeignApi.core%7Cmediawiki.editfont.styles%7Cmediawiki.libs.pluralruleparser%7Cmediawiki.page.ready%7Cmediawiki.page.watch.ajax%7Cmediawiki.ui.button%2Cicon%7Cmmv.bootstrap%2Chead%7Cmmv.bootstrap.autostart%7Cmw.config.values.wbDataTypes%2CwbRefTabsEnabled%2CwbRepo%2CwbSiteDetails%7Coojs-ui-core.icons%2Cstyles%7Coojs-ui-toolbars.icons%7Coojs-ui-widgets.icons%7Coojs-ui-windows.icons%7Coojs-ui.styles.indicators%7CpropertySuggester.suggestions%7Cskins.vector.legacy.js%7Cuser.defaults%7Cutil.ContentLanguages%2CExtendable%2CMessageProvider%2CMessageProviders%2CNotifier%2ChighlightSubstring%2Cinherit%7CvalueParsers.ValueParserStore%2Cparsers%7Cwikibase.EntityInitializer%2CSite%2CWikibaseContentLanguages%2CbuildErrorOutput%2Cdatamodel%2CgetLanguageNameByCode%2CgetUserLanguages%2Cserialization%2Csites%2Ctainted-ref%2Ctemplates%7Cwikibase.api.RepoApi%2CValueCaller%7Cwikibase.entityChangers.EntityChangersFactory%7Cwikibase.entityPage.entityLoaded%7Cwikibase.experts.Entity%2CForm%2CItem%2CLexeme%2CProperty%2CSense%2C__namespace%2Cmodules%7Cwikibase.formatters.ApiValueFormatter%7Cwikibase.quality.constraints.suggestions%7Cwikibase.ui.entityViewInit%2Centitysearch%7Cwikibase.utilities.ClaimGuidGenerator%7Cwikibase.view.ControllerViewFactory%2CReadModeViewFactory%2C__namespace&skin=vector&version=nsq19

Event Timeline

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

The link to logstash doesn't work anymore. Can you share it using the share function?

The link to logstash doesn't work anymore. Can you share it using the share function?

It works for me? It links to a single error-document.

But you can also see it on the general Wikidata client errors dashboard. Filtering for that error specifically: https://logstash.wikimedia.org/goto/2f63064927c24507b7b9954a39098400

I swear it didn't work when I clicked on it before. Now it works...

I couldn't reproduce the bug but the whole code for it is useless and can be easily dropped (and give us a rather large performance gain). The class repositions the property label on scroll but you can simply use sticky position for it (look at this cute sharks). When it was written, there was no support for it but currently the only thing that doesn't support sticky positioning is IE11 (< 1% traffic). It won't cause much issues for it, just the label will be hidden if the user scrolls on large statements (just for IE11). Is that okay for you @Lydia_Pintscher ?

Change 666093 had a related patch set uploaded (by Ladsgroup; owner: Ladsgroup):
[mediawiki/extensions/Wikibase@master] Drop statementgrouplabelscroll and use position: sticky instead

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

I couldn't reproduce the bug but the whole code for it is useless and can be easily dropped (and give us a rather large performance gain). The class repositions the property label on scroll but you can simply use sticky position for it (look at this cute sharks). When it was written, there was no support for it but currently the only thing that doesn't support sticky positioning is IE11 (< 1% traffic). It won't cause much issues for it, just the label will be hidden if the user scrolls on large statements (just for IE11). Is that okay for you @Lydia_Pintscher ?

Performance gain? Yes please! :D

I saw it because when I scrolled to reproduce the error, Firefox put a performance warning and linked to this article: https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Scroll-linked_effects

Also, 1% or not, IE11 is still supposed to be a grade A browser. Are we deciding to abandon it?

Also, 1% or not, IE11 is still supposed to be a grade A browser. Are we deciding to abandon it?

We already abandoned IE11 support for lexemes AFAIK. This one just would be hiding the property label on large statements on scroll. It's not anything critical.

We already abandoned IE11 support for lexemes

After checking, not so sure about this anymore. I continue checking but I still think we should do it. It's not critical, gives huge performance boost and IE11 is already in the process of being dropped for new features. The last call is on Lydia though.

Since we're just talking about the scrolling of the Property I think this is an entirely ok thing to not have for IE 11 if it helps everyone else with performance. It's not critical functionality but just makes things a tiny bit nicer.

I did a quick performance profiling using chrome devtools and 4x CPU slowdown:
In 900ms of scrolling, in the status quo we have:

image.png (835×1 px, 123 KB)

With the path applied we have:

image.png (744×1 px, 82 KB)

What does it mean:

  • Currently, in every second of scroll, the cpu is 8ms idle but with sticky position it spends 525ms idle.
  • But it's not just twice faster cpu-wise, it also handles twice more scroll events (from ~30 to ~60) meaning it renders more lively to users.
  • It basically means it's four times faster.

Change 666093 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Drop statementgrouplabelscroll and use position: sticky instead

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

I'm doing it. Keeping it open until it gets deployed so people don't make a new ticket by mistake.

(no instances of the bug today! hurrah!)