Page MenuHomePhabricator

Multiple TypeError: wikibase.quality is undefined errors on page load
Closed, ResolvedPublic5 Estimated Story Points

Description

Upon visiting https://commons.m.wikimedia.org/wiki/File:%27%27Newspaper_Reader%27%27_by_J._Seward_Johnson_Jr._(1975).jpg when logged in I get a flood of these errors in my console.

jQuery.Deferred exception: wikibase.quality is undefined 
resources/statements/ConstraintsReportHandlerElement.js/ConstraintsReportHandlerElement.prototype.buildReport@https://commons.m.wikimedia.org/w/load.php?lang=en&modules=dataValues%2Cjquery%2Coojs%2Coojs-router%2Coojs-ui-core%2Coojs-ui-widgets%2Coojs-ui-

Acceptance Criteria:πŸ•οΈπŸŒŸ

  • The error should not occur in production

Notes:

  • Ideally QualityConstraints and MobileFrontend, Wikibase and MediaInfo Extensions need to be installed in your local machine
  • There are no known steps to reproduce this locally. The link to production in the description may be the place to start. It may be as "easy" as installing all the needed extensions and creating a MediaInfo object

Event Timeline

I just tried reproducing this following the steps in the description @Jdlrobson but I don't appear to be able to see the error.
I also just looked in logstash and don't see this in client side error logging at all.
@Jdlrobson can you still reproduce this?

Wikidata-Campsite (Wikidata-Campsite-Iteration-∞ (On Hold)) might not need to look at this if this is not the case.

I can still reproduce it by visiting https://commons.m.wikimedia.org/wiki/File:%27%27Newspaper_Reader%27%27_by_J._Seward_Johnson_Jr._(1975).jpg. Note that the message are classified as warnings in the console, not errors, so you might need to tweak the console settings so they’re not hidden.

Ahh yes, thanks for the pointer!

image.png (1Γ—2 px, 519 KB)

One thing that helps in reproducing the error is clearing the browser cache.

I did some investigation on this if it's any help I think adding target: ["mobile", "desktop"] to module definition of two RL modules in WBQC would fix the issue. The modules are https://gerrit.wikimedia.org/g/mediawiki/extensions/WikibaseMediaInfo/+/f6f9bf1ce35b25a3d134e41b8d87a36c2d9c9d97/src/WikibaseMediaInfoHooks.php#327

Change 690008 had a related patch set uploaded (by Rosalie Perside (WMDE); author: Rosalie Perside (WMDE)):

[mediawiki/extensions/WikibaseQualityConstraints@master] WIP

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

Change 690008 merged by jenkins-bot:

[mediawiki/extensions/WikibaseQualityConstraints@master] Adding targets to wikibase.quality.constraints.ui module

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