Page MenuHomePhabricator

Various client errors relating to MobileFrontend section collapsing
Closed, ResolvedPublicPRODUCTION ERROR

Description

There were 78436 errors in last 7 days relating to MobileFrontend section collapsing beginning in wmf16.

Screenshot 2026-03-11 at 8.22.01 AM.png (305×1 px, 53 KB)

Based on the date these errors all seem related.
https://logstash.wikimedia.org/goto/bc04e052e827e62b23760c606cb980c0

The errors are:

TypeError: Cannot read properties of null (reading 'tagName')631
TypeError: null is not an object (evaluating 'i.tagName')121
TypeError: undefined is not an object (evaluating 'content.classList.add')90
TypeError: can't access property "nextSibling", heading is null58
TypeError: can't access property "add", content.classList is undefined55
TypeError: Cannot read property 'nextSibling' of null34
TypeError: heading is null9

Steps to replicate the issue (include links if applicable):

What happens?:

What should have happened instead?:

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

Restricted Application changed the subtype of this task from "Bug Report" to "Production Error". · View Herald TranscriptMar 11 2026, 3:24 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
bvibber subscribed.

Likely more regressions on T416063, I'll add it to my pile today!

Hey @bvibber there is a lot of these errors so I'd like to backport something later today. Is there a change we could revert?

Change #1250639 had a related patch set uploaded (by Bvibber; author: Bvibber):

[mediawiki/extensions/MobileFrontend@master] Revert "Fix for temp section open during slow loads on Parsoid"

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

Change #1250639 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Revert "Fix for temp section open during slow loads on Parsoid"

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

Change #1250647 had a related patch set uploaded (by Bvibber; author: Bvibber):

[mediawiki/extensions/MobileFrontend@wmf/1.46.0-wmf.18] Revert "Fix for temp section open during slow loads on Parsoid"

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

Change #1250648 had a related patch set uploaded (by Bvibber; author: Bvibber):

[mediawiki/extensions/MobileFrontend@wmf/1.46.0-wmf.19] Revert "Fix for temp section open during slow loads on Parsoid"

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

Change #1250647 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@wmf/1.46.0-wmf.18] Revert "Fix for temp section open during slow loads on Parsoid"

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

Change #1250648 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@wmf/1.46.0-wmf.19] Revert "Fix for temp section open during slow loads on Parsoid"

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

Mentioned in SAL (#wikimedia-operations) [2026-03-11T20:10:19Z] <bvibber@deploy2002> Started scap sync-world: Backport for [[gerrit:1250647|Revert "Fix for temp section open during slow loads on Parsoid" (T416063 T419170 T419721)]], [[gerrit:1250648|Revert "Fix for temp section open during slow loads on Parsoid" (T416063 T419170 T419721)]]

Mentioned in SAL (#wikimedia-operations) [2026-03-11T20:12:29Z] <bvibber@deploy2002> bvibber: Backport for [[gerrit:1250647|Revert "Fix for temp section open during slow loads on Parsoid" (T416063 T419170 T419721)]], [[gerrit:1250648|Revert "Fix for temp section open during slow loads on Parsoid" (T416063 T419170 T419721)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-03-11T20:17:06Z] <bvibber@deploy2002> Finished scap sync-world: Backport for [[gerrit:1250647|Revert "Fix for temp section open during slow loads on Parsoid" (T416063 T419170 T419721)]], [[gerrit:1250648|Revert "Fix for temp section open during slow loads on Parsoid" (T416063 T419170 T419721)]] (duration: 06m 47s)

The patch has been reverted pending fixes...

Noting, that the issue TypeError: null is not an object (evaluating 'i.tagName') seems to actually relate to the table of contents experiment being enabled so might surface again if we re-enable it.

Change #1251546 had a related patch set uploaded (by Bvibber; author: Bvibber):

[mediawiki/extensions/MobileFrontend@master] WIP Reworked fix for temp section open during slow loads on Parsoid

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

Updated & simplified patch on is deliberately more resilient to errors:

  • uses ES5 syntax so won't break even on super old browsers
  • checks everything for nulls
  • simplified by dropping the icon setup and just doing the click handler with a raw expansion

Additionally the inline JS payloads for both legacy and parsoid modes have been broken out of HEREDOC strings and into .js files under resources/inline/ so they can be edited with syntax highlighting and linting. The existing linter setup in the pre-commit hook will prevent commits with linter errors in these scripts from passing now.

https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MobileFrontend/+/1251546

taavi raised the priority of this task from High to Unbreak Now!.Mon, Mar 16, 8:25 AM
taavi subscribed.

This is marked as a train blocker for this week, thus raising priority.

Checking in this morning, caching is still impacting this issue but we are down to just 504 errors in the last 24hrs which is under the threshold for what we consider a problem (1000). I'll keep monitoring this and open a ticket if I have indication this does not relate to caching.

Change #1251546 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Reworked fix for temp section open during slow loads on Parsoid

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

Change #1255006 had a related patch set uploaded (by Bvibber; author: Bvibber):

[mediawiki/extensions/MobileFrontend@master] Guard for JS null deref on empty Parsoid sections

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

Change #1255013 had a related patch set uploaded (by Jdlrobson; author: Bvibber):

[mediawiki/extensions/MobileFrontend@wmf/1.46.0-wmf.20] Guard for JS null deref on empty Parsoid sections

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

Change #1255006 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Guard for JS null deref on empty Parsoid sections

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

Change #1255013 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@wmf/1.46.0-wmf.20] Guard for JS null deref on empty Parsoid sections

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

Mentioned in SAL (#wikimedia-operations) [2026-03-18T20:57:30Z] <jdlrobson@deploy2002> Started scap sync-world: Backport for [[gerrit:1255013|Guard for JS null deref on empty Parsoid sections (T419721)]], [[gerrit:1254889|Reapply "hcaptcha: Enforce hCaptcha on API edits coming from the MobileFrontend" (T419125)]]

Mentioned in SAL (#wikimedia-operations) [2026-03-18T20:59:36Z] <jdlrobson@deploy2002> jdlrobson, harroyo-wmf: Backport for [[gerrit:1255013|Guard for JS null deref on empty Parsoid sections (T419721)]], [[gerrit:1254889|Reapply "hcaptcha: Enforce hCaptcha on API edits coming from the MobileFrontend" (T419125)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-03-18T21:08:50Z] <jdlrobson@deploy2002> Finished scap sync-world: Backport for [[gerrit:1255013|Guard for JS null deref on empty Parsoid sections (T419721)]], [[gerrit:1254889|Reapply "hcaptcha: Enforce hCaptcha on API edits coming from the MobileFrontend" (T419125)]] (duration: 11m 20s)

Note: I had to revert the workaround on itwiki. Section collapsing was broken on mobile: clicking on an open section header only hid the edit icon, not the actual section. The bug was not reproducible in safemode, hence leading me to that override. I am not familiar with the section collapsing code, but one thing I did notice is that even though the code clears the mfTempClickHandler, by the time that happens, the function has already been registered as a click handler. So, its original implementation would still be executed upon clicking. Maybe there was a better workaround, but given it's saturday morning and this task has been resolved, I've just removed the code without looking further; and sections are now working again.

Sorry @Daimona I dropped the ball on that. Thank you for removing.