Page MenuHomePhabricator

Categories view in mobile is broken [firefox]
Closed, DeclinedPublic

Description

In MobileFrontend, file resources/mobile.categories.overlays/CategoryOverlay.js:

data.query.pages.forEach(function (page) {

It does forEach on map (introduced in: https://gerrit.wikimedia.org/r/#/c/345257/ )

However, this is not supported in Firefox causing TypeError: data.query.pages.forEach is not a function

Event Timeline

PS: aren't there compatibility tests that run regularly that can catch it before it gets to production?

Change 349931 had a related patch set uploaded (by Jhernandez):
[mediawiki/extensions/MobileFrontend@master] Fix Object being treated as an Array

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

Broken in prod everywhere:

I messed this one up. Let's get it fixed ASAP.

Help with review please. We'll need to SWAT this.

Thanks a lot @eranroz for the report.

This feature has very poor test coverage, not being covered by neither browser tests nor unit tests, and we don't have yet production logging of JS errors. Sadly I missed this part when testing the patch manually... :(

PS: aren't there compatibility tests that run regularly that can catch it before it gets to production?

No. Should there be? Yes. There's A Task For That™: T161050: Rewrite CategoryOverlay using composition, adding tests 😄

OK. This has already been fixed by rEMFR0ad0ed59a52f: Retrieve categories using the API format version 2. The fix wasn't deployed last week because of the deployment freeze. It'll be deployed to the Wikipedias by this Thursday (Thursday, 27th April). It could be deployed during any SWAT window prior to that though…

Change 349931 abandoned by Jhernandez:
Fix Object being treated as an Array

Reason:
Already fixed by using formatversion=2 on the api, see https://phabricator.wikimedia.org/T163530#3206003

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

After chatting with @phuedx, it seems like this was fixed about 2 weeks ago but wasn't deployed because of the deployment freeze. Given it is a beta only feature and that it already has a merged fix we should let it ride the train tomorrow, and it would get deployed to big wikis on Thursday.

Closing this as invalid then.

Thanks for poking this it made me discover T163699 in the process :)