Page MenuHomePhabricator

Uncaught ReferenceError: mfTempOpenSection is not defined on main pages
Closed, ResolvedPublic2 Estimated Story PointsPRODUCTION ERROR

Description

Error message
Uncaught ReferenceError: mfTempOpenSection is not defined
at HTMLHeadingElement.onclick  https://m.mediawiki.org/wiki/MediaWiki:106:1497

See mw-client-errors

Impact

Sections cannot be opened by users on very slow mobile connections on the main page.

This happens during the first few seconds of the page visit for all users (depending on connection and device speed).

And it happens all the time for users of a Grade C browser, and for users where the JS request failed or timed out (e.g. intermittent connectivity or a after bad deploy).

Developer

This appears to occur on the home page e.g. https://m.mediawiki.org/wiki/MediaWiki

Interim toggling supported is added via global function mfTempOpenSection inside https://github.com/wikimedia/mediawiki-extensions-MobileFrontend/blob/master/includes/MobileFrontendSkinHooks.php#L14

which is then removed https://github.com/wikimedia/mediawiki-extensions-MobileFrontend/blob/master/src/mobile.init/toggling.js#L30

for some reason this is not added on the main page
https://github.com/wikimedia/mediawiki-extensions-MobileFrontend/blob/master/includes/MobileFrontendHooks.php#L271

There is no reason not to add the code on the main page. Some main pages will not use it but that's not a big problem.
Fix is therefore straightforward.

Details

Request URL
https://m.mediawiki.org/wiki/MediaWiki

Event Timeline

Krinkle triaged this task as High priority.EditedMar 10 2020, 12:12 AM
Krinkle added a project: Readers-Web-Backlog.

Tentatively setting High as this might mean that most content is inaccessible for a significant part of our audience. Not sure..

Jdlrobson renamed this task from Uncaught ReferenceError: mfTempOpenSection is not defined to Uncaught ReferenceError: mfTempOpenSection is not defined on main pages.Mar 18 2020, 12:31 AM
Jdlrobson updated the task description. (Show Details)

Change 580545 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Add interimTogglingSupport to main pages

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

Jdlrobson added subscribers: ovasileva, Jdlrobson.

@Krinkle looks like an easy review if you have time.

@Jdlrobson: It's not clear why that Title::isMainPage test was added in I9bc8421e (see T168567: MobileFormatter: Do not scrub elements on pages in template namespace). It seems that you reviewed and merged the change. Do you remember?

@Jdlrobson: It's not clear why that Title::isMainPage test was added in I9bc8421e (see T168567: MobileFormatter: Do not scrub elements on pages in template namespace). It seems that you reviewed and merged the change. Do you remember?

In that patch I was just keeping the status quo. I imagine this is a leftover from when the main page was always special cased. When it's special cased sections are never collapsed but if it isn't they can be.

ovasileva set the point value for this task to 3.Mar 18 2020, 5:16 PM
ovasileva changed the point value for this task from 3 to 2.

Change 580545 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Add interimTogglingSupport to main pages

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

This is a technical QA so I'll handle this during and after tomorrow's train

This looks done to me. Logs are running clean.