Page MenuHomePhabricator

Content from a template duplicated in a DiscussionTools edit
Closed, ResolvedPublic

Description

Content from a template duplicated in a DiscussionTools edit: https://it.wikipedia.org/?diff=122887197

I saw something similar in another edit recently: https://pt.wikipedia.org/wiki/Especial:Registro_de_abusos/5994342 (note: this is a link to abuse filter log, you might not have permissions to view it; the edit was blocked by the abuse filter for unrelated reasons and not saved, and it came up in T289873#7315523; I can share the diff privately if it's helpful).

Event Timeline

(This looks similar to T269548, but I can't find any tables with fostered content in either case.)

ppelberg added a project: Editing-team.
ppelberg moved this task from Untriaged to Next Quarter on the Editing-team board.

Seemingly another one: https://it.wikipedia.org/?diff=123057020

Taking a quick look at the HTML,

<p about="#mwt880" typeof="mw:Transclusion" data-mw='{"parts":[" Spam. Necessaria anche pulizia. --[[Utente:Lorenzo Longo|&lt;span style=\"color:black;font-weight:bold;font-family:serif\">&apos;&apos;Lollo&apos;&apos;&lt;/span>]] [[Discussioni utente:Lorenzo Longo|&lt;span style=\"color:Blue;\">&apos;&apos;Scrivimi&apos;&apos;&lt;/span>]] 15:03, 18 set 2021 (CEST)\n\n",{"template":{"target":{"wt":"vandalo","href":"./Template:Vandalo"},"params":{"1":{"wt":"87.17.247.90"}},"i":0}}]}' id="mwCEA"> Spam. Necessaria anche pulizia. --<a rel="mw:WikiLink" href="./Utente:Lorenzo_Longo" title="Utente:Lorenzo Longo"><span style="color:black;font-weight:bold;font-family:serif"><i>Lollo</i></span></a> <a rel="mw:WikiLink" href="./Discussioni_utente:Lorenzo_Longo" title="Discussioni utente:Lorenzo Longo"><span style="color:Blue;"><i>Scrivimi</i></span></a> 15:03, 18 set 2021 (CEST)

<link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r108099627" about="#mwt883" typeof="mw:Extension/templatestyles" data-mw='{"name":"templatestyles","attrs":{"src":"Vandalo/styles.css"}}'/><span about="#mwt883">
<!-- DiscussionTools addDiscussionTools called --></span></p><div class="toccolours report" about="#mwt880"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r119428018" about="#mwt884" typeof="mw:Extension/templatestyles" data-mw='{"name":"templatestyles","attrs":{"src":"Utente/styles.css"}}'/><span about="#mwt884">
<!-- DiscussionTools addDiscussionTools called --></span><span class="utente-username">87.17.247.90</span> (<a rel="mw:WikiLink" href="./Discussioni_utente:87.17.247.90" title="Discussioni utente:87.17.247.90">discussioni</a><b><span typeof="mw:Entity"> </span>·</b> <a rel="mw:WikiLink" href="./Speciale:Contributi/87.17.247.90" title="Speciale:Contributi/87.17.247.90">contributi</a><b><span typeof="mw:Entity"> </span>·</b> <a rel="mw:WikiLink" href="./Speciale:ContributiCancellati/87.17.247.90" title="Speciale:ContributiCancellati/87.17.247.90">cancellati</a><b><span typeof="mw:Entity"> </span>·</b> <a rel="mw:WikiLink" href="./Speciale:Registri/87.17.247.90" title="Speciale:Registri/87.17.247.90">registri</a><b><span typeof="mw:Entity"> </span>·</b> <a rel="mw:WikiLink" href="./Speciale:Blocca/87.17.247.90" title="Speciale:Blocca/87.17.247.90">blocca</a><b><span typeof="mw:Entity"> </span>·</b> <span class="plainlinks"><a rel="mw:ExtLink" href="//it.wikipedia.org/w/index.php?title=Speciale:Registri&amp;type=block&amp;page=Utente:87.17.247.90" class="external text">blocchi</a></span><b><span typeof="mw:Entity"> </span>·</b> <a rel="mw:ExtLink" href="https://whois.domaintools.com/87.17.247.90" class="external text">whois</a>)</div><meta property="mw:PageProp/expectedUnconnectedPage" about="#mwt880"/>

the template range for {{vandalo|87.17.247.90}} is expanded to include the comment "Spam. Necessaria anche pulizia. -- ..." so presumably, when the reply to it is inserted, it's breaking up the templates about grouping. Since the template wrapper contains all the info to reserialize the template from the data-mw parts, it gets restored. But the stranded content gets serialized to its HTML equivalent.

Parsoid could maybe be coaxed to drop dissociated about annotated nodes but more likely DiscussionTools should probably not be breaking them up.

Yes, DT shouldn't be breaking them up. If you think about it from a source edit POV, there is no way to insert a reply in the middle of a {{some-template-here}}.

Content from a template duplicated in a DiscussionTools edit: https://it.wikipedia.org/?diff=122887197

After looking at it more closely today, I realize I misdiagnosed it – the added content doesn't look like it was duplicated from a template, I think it is another template that was substituted (either intentionally by the user typing subst:, or by some bug, we can't tell).

But note also how it was inserted in the middle of the preceding comment, and also how the added template is after the new signature instead of before it. I don't know how that happened, there's definitely a bug here, but I don't understand it.

After looking at it more closely today, I realize I misdiagnosed it – the added content doesn't look like it was duplicated from a template,

It looks like it's duplicated from {{avviso revisione bozza|Raimondo Grassi}}. Note that that template has changed in the time since that edit was made, so the duplicated content is showing the old version and the rendered template shows the new, which accounts for the difference.

See https://it.wikipedia.org/w/index.php?title=Template:Avviso_revisione_bozza&oldid=123046386

But note also how it was inserted in the middle of the preceding comment, and also how the added template is after the new signature instead of before it. I don't know how that happened, there's definitely a bug here, but I don't understand it.

My guess is that this is similar to the above T290940#7375053, where the about grouping got broken up by inserting a comment in between. The template has gone through a few edits but likely beforehand its ranges were extended to encompass the above comment that was replied to.

The bug can be reproduced here: https://en.wikipedia.beta.wmflabs.org/wiki/Talk:T290940. It was easier than I thought…

Comment 2, which was inside a template, gets duplicated when replying to comment 1: https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Talk:T290940&diff=513950&oldid=513949&diffmode=source

Wikitext
1 [[User:Yatu|Yatu]] ([[User talk:Yatu|talk]]) 14:21, 12 November 2021 (UTC){{echo|

2 [[User:Yatu|Yatu]] ([[User talk:Yatu|talk]]) 14:22, 12 November 2021 (UTC)}}

3 [[User:Yatu|Yatu]] ([[User talk:Yatu|talk]]) 14:23, 12 November 2021 (UTC)
Parsoid HTML
<p id="mwAg">1 <a rel="mw:WikiLink" href="./User:Yatu" title="User:Yatu" id="mwAw">Yatu</a> (<a rel="mw:WikiLink" href="./User_talk:Yatu" title="User talk:Yatu" id="mwBA">talk</a>) 14:21, 12 November 2021 (UTC)</p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"\n\n2 [[User:Yatu|Yatu]] ([[User talk:Yatu|talk]]) 14:22, 12 November 2021 (UTC)"}},"i":0}}]}' id="mwBQ">

</span><p about="#mwt1">2 <a rel="mw:WikiLink" href="./User:Yatu" title="User:Yatu">Yatu</a> (<a rel="mw:WikiLink" href="./User_talk:Yatu" title="User talk:Yatu">talk</a>) 14:22, 12 November 2021 (UTC)</p>

<p id="mwBg">3 <a rel="mw:WikiLink" href="./User:Yatu" title="User:Yatu" id="mwBw">Yatu</a> (<a rel="mw:WikiLink" href="./User_talk:Yatu" title="User talk:Yatu" id="mwCA">talk</a>) 14:23, 12 November 2021 (UTC)</p>

There's a <span> with the template metadata between the two paragraphs, and apparently we insert the reply after the <span>, breaking the about-group exactly as @Arlolra said.

I actually thought that Parsoid would mark the whole first paragraph as part of the transclusion. I guess it's good for most use cases that it doesn't, but we'll need to fix some assumptions in our tool for this.

Change 738474 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/DiscussionTools@master] Test case for T290940

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

Change 738475 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/DiscussionTools@master] Avoid splitting about-groups starting with an empty <span>

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

Change 738474 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/DiscussionTools@master] Test case for splitting about-groups

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

Change 738474 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Test case for splitting about-groups starting with an empty <span>

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

Change 738475 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Avoid splitting about-groups starting with an empty <span>

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

There were two more affected edits before the patch was deployed:

Hopefully there won't be any more.

It seems like the issues on it.wikipedia.org are still occurring, I filed T298051. I haven't seen new appearances of the other corruption issues.