Page MenuHomePhabricator

Legacy parser rendering showing after VE edit on wikis where Parsoid read-views are deployed (still with the "rendered with Parsoid" tag)
Closed, ResolvedPublicBUG REPORT

Description

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

On a wiki where Parsoid read-views is deployed (or with an account that is in "parsoid always-on" setting), edit a wiki page; observe what is shown just after the edit in the read view.

What happens?:

The legacy parsing is displayed.

What should have happened instead?:

The Parsoid rendering should be displayed. Or, if not, at least the "Rendered with Parsoid"

Note

It's not trivial to see, because it STILL displays the "rendered with Parsoid" tag, and displaying the source is enough to get the Parsoid version in the source. But, the discrepancies between Parsoid and legacy disappear (... since we're, in fact, seeing legacy); inspecting elements in the browser shows legacy source.

It happens whether the edit is done with VE, whether in "visual" or "editing" mode, but not when editing with the "old" (pre-2017) wikitext editor.

Reloading the page shows the Parsoid output as expected.

Event Timeline

Maybe related, maybe not: when I log in to a new wiki I'm not always seeing my preferences (including the "rendered with Parsoid") applied. The thing I notice most is user interface language, which often is still in the wiki's content language. I have to manually reload to get a render with English as the interface language (which is a global preference).

That's *probably* not related... but it might be a similar cache key issue behind both? I'm also wondering if there's browser caching involved here.

I think what's going on is that VE is reloading the content area w/o doing a full reload of the page, and VE isn't using the ArticleParserOptions hook appropriately to get the proper 'useParsoid' status.

VE is basically calling out to the Parse API to get that -- see ApiVisualEditorEdit. So presumably that isn't using the appropriate hook?

Same applies to the preview from the 2017 wikitext editor, though that's called directly from JS rather than going through VE's edit API.

Change #1068122 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/extensions/VisualEditor@master] Ensure page is reloaded after edit using Parsoid if appropriate

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

Change #1068125 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/core@master] Allow ApiParse to use the ArticleParserOptions hook

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

Change #1068122 abandoned by C. Scott Ananian:

[mediawiki/extensions/VisualEditor@master] Ensure page is reloaded after edit using Parsoid if appropriate

Reason:

Abandoned in favor of I18147254f1ac5f08a57e85eb2f031df7701dccef

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

Change #1068812 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/extensions/VisualEditor@master] Ensure page is reloaded after edit using Parsoid if appropriate

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

Change #1068125 merged by jenkins-bot:

[mediawiki/core@master] Allow ApiParse to use the ArticleParserOptions hook

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

Change #1068812 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Ensure page is reloaded after edit using Parsoid if appropriate

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

cscott claimed this task.

This patch is /almost/ correct, but it doesn't acknowledge the useparsoid query string. So if Parsoid is your default, you "switch to legacy parser", hit edit (maybe with the source editing mode of VE) and then save, it will reload with Parsoid enabled even though ?useparsoid=0 is in the query string. Filed T374532 as a follow up and closing this task.