Page MenuHomePhabricator

Parsoid read views show empty SDC data
Closed, DuplicatePublicBUG REPORT

Description

Current status: Worked around by disabling ParserMigration on Commons (i.e. the issue is not reproducible on Commons at the moment), which should be reverted once T351113 is resolved.

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

Quick steps:

Original steps:

What happens?:

  • Edit is still not reflected on the read view

What should have happened instead?:

  • I see the claim I just added

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

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

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
taavi renamed this task from SDC edits not reflected in read actions to SDC edits not reflected in read actions with parsoid read views enabled.May 4 2024, 1:12 PM

That’s weird. My first guess was that mw.values.get( 'wbEntity' ) was missing, but it’s there AFAICT. So why is the WikibaseMediaInfo UI not picking it up?

I can also reproduce the issue at https://commons.wikimedia.org/wiki/File:CSD_Berlin_2019_-_Lucas_Werkmeister_-_24_-_Bi,_Pan,_Ace_Flags.jpg?useparsoid=1 (so it’s not limited to P180 / depicts).

Looking at the code in filepage/init.js, I think the code is actually trying to “hydrate” the existing markup (rather than recreate it) – and it looks like the Parsoid markup has the statements group empty. (It’s present, but has no content.) Screenshot without JavaScript:

image.png (431×1 px, 102 KB)

So we need to find out how that’s added in PHP – maybe some hook that Parsoid doesn’t use? (But then you’d expect it to be completely absent, not empty…)

I can reproduce the issue locally (after installing Extension:ParserMigration with $wgParserMigrationEnableQueryString = true;), so that’s good.

WikibaseMediaInfoHooks::extractStructuredDataHtml() tries to get the structured data part from the given HTML; if it can’t find it, it instead renders an empty structured data view and renders that. This is apparently what’s happening; its regex looks for <mediaInfoView> elements in the HTML, but I see no trace of that in the $html I see in the debugger.

As far as I can tell, non-Parsoid page renders call MediaInfoView::getContent() via EntityHandler::fillParserOutput() and FullEntityParserOutputGenerator::addHtmlToParserOutput(); Parsoid page renders don’t even reach EntityHandler::fillParserOutput() when the page is a file. (But they do reach it for normal page renders. No idea what’s different about file pages yet.)

Well, that would be why.

RevisionRenderer::combineSlotOutput()
		// short circuit if there is only the main slot
		// T351026 hack: if use-parsoid is set, only return main slot output for now
		// T351113 will remove this hack.
		if ( array_keys( $slots ) === [ SlotRecord::MAIN ] || $options->getUseParsoid() ) {
			return $rrev->getSlotParserOutput( SlotRecord::MAIN, $hints );
		}

So we’ll just have to wait for T351113 to remove the T351026 hack.

Lucas_Werkmeister_WMDE renamed this task from SDC edits not reflected in read actions with parsoid read views enabled to Parsoid read views show empty SDC data.May 4 2024, 2:51 PM

And in the meantime, tbh I feel like we might want to disable ParserMigration on Commons. Showing the SDC data as empty is pretty bad; it doesn’t break editing (I made this edit with ?useparsoid=1 – newly added statements are correctly shown too), so conceivably someone with that preference enabled could be adding duplicate data all over Commons without even realizing it.

And in the meantime, tbh I feel like we might want to disable ParserMigration on Commons. Showing the SDC data as empty is pretty bad; it doesn’t break editing (I made this edit with ?useparsoid=1 – newly added statements are correctly shown too), so conceivably someone with that preference enabled could be adding duplicate data all over Commons without even realizing it.

Quickly discussed this with @ssastry and he said a config change sounds okay. (But I don’t think it’s urgent enough for a weekend deployment, so I’m happy to leave a bit more time for discussion on Gerrit after I upload the config change.)

Change #1027194 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[operations/mediawiki-config@master] Disable ParserMigration on commonswiki

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

Side note: if we still had a testcommonswiki (T213295), we could leave ParserMigration enabled there and use it to test this bug when T351113 is done. (Last time I pointed out that a Test Wikimedia Commons is in fact useful, I was told that testing can happen on the Beta cluster instead, but given how often it’s broken you’ll forgive me if I’m not very convinced by that argument.)

Change #1027194 merged by jenkins-bot:

[operations/mediawiki-config@master] Disable ParserMigration on commonswiki

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

Mentioned in SAL (#wikimedia-operations) [2024-05-09T09:36:08Z] <jforrester@deploy1002> Started scap: Backport for [[gerrit:1027194|Disable ParserMigration on commonswiki (T364228)]]

Mentioned in SAL (#wikimedia-operations) [2024-05-09T09:38:50Z] <jforrester@deploy1002> lucaswerkmeister-wmde and jforrester: Backport for [[gerrit:1027194|Disable ParserMigration on commonswiki (T364228)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-05-09T09:52:25Z] <jforrester@deploy1002> Finished scap: Backport for [[gerrit:1027194|Disable ParserMigration on commonswiki (T364228)]] (duration: 16m 17s)

Lucas_Werkmeister_WMDE changed the task status from Open to Stalled.May 13 2024, 8:46 AM

This is worked around for now, but I feel like we want to leave the task open for eventually reverting the config change… tentatively marking as stalled for now.