iOS and Android apps aren't showing section edit previews for non-intro sections.
- The post request that the apps make is failing: https://en.wikipedia.org/api/rest_v1/transform/wikitext/to/mobile-html/Grinnell_College
This is the response:
{
"type": "https://mediawiki.org/wiki/HyperSwitch/errors/internal_error",
"title": "TypeError",
"method": "POST",
"detail": "Cannot read property 'tagName' of null",
"uri": "/en.wikipedia.org/v1/transform/html/to/mobile-html/Geographic_center_of_the_United_States"
}Some background
The wikitext/to/mobile-html call [restbase, I believe] just pipes output from wikitext/to/html API [parsoid, I believe] into html/to/mobile-html [in PCS].
Some investigation
If you remove the section header from the wikitext, it doesn't fail. (And thus the intro section doesn't fail, as it doesn't have a section header.)
The html-to-mobile-html conversion is failing because the request html (in part) looks like this:
<body id="mwAA" lang="en" class="mw-content-ltr sitedir-ltr ltr mw-body-content parsoid-body mediawiki mw-parser-output" dir="ltr"> <section data-mw-section-id="0" id="mwAQ"></section> <section data-mw-section-id="1" id="mwAg"> <h2 id="Social_activities_and_organizations">Social activities and organizations</h2>
If you remove <section data-mw-section-id="0" id="mwAQ"></section>, it works just fine.
I can replicate this bug locally with PCS. Thus the current question is "did parsoid recently chagne and add that empty section, or did PCS recently change and become unable to handle that empty section?"
From pulling an older version of PCS, it seems that this is a PCS problem. I'm currently working on isolating exactly which merge introduced the problem.