Page MenuHomePhabricator

Reply tool adds replies directly on ptwiki's Village pump instead of on a transcluded subpage (and triggers an Abuse Filter)
Closed, ResolvedPublic

Description

Try using the [reply] tool at https://pt.wikipedia.org/wiki/Wikipédia:Esplanada/geral?dtenable=1#Discussion_tools_update

The error produced is: Erro: Sua edição foi impedida pois está tentando inserir um comentário diretamente na Esplanada. Tenha em mente que, de acordo com discussão, tópicos devem ser criados como subpáginas com o auxílio do gadget. Clique aqui para criar um novo tópico na seção geral ou clique aqui para criar um novo tópico na seção de propostas.

Event Timeline

Based on automatic translation of the error message, it looks like the reply tool was trying to add your reply directly on the village pump page (i.e. https://pt.wikipedia.org/w/index.php?title=Wikipédia:Esplanada/geral&action=edit), but it's supposed to be added on a subpage (i.e. https://pt.wikipedia.org/w/index.php?title=Wikipédia:Esplanada/geral/Discussion_tools_update_(20ago2021)&action=edit).

The reply tool usually supports that, and when I try to reply there now, I get the small message in the footer that the reply will be posted at "Wikipédia:Esplanada/geral/Discussion tools update (20ago2021)":

image.png (2×3 px, 701 KB)

Possibly this doesn't work correctly on that page when there's just one comment?

Also, I looked up your edit that was prevented on Special:AbuseLog, and the details include a diff: https://pt.wikipedia.org/wiki/Especial:Registro_de_abusos/5994342 – and the diff looks like page corruption (it duplicates some content from the subpage that you certainly did not try to add). Maybe there's a Parsoid issue here too.

matmarex renamed this task from Reply tool triggers an Abuse Filter at ptwiki's Village pump to Reply tool adds replies directly on ptwiki's Village pump instead of on a transcluded subpage (and triggers an Abuse Filter).Nov 16 2021, 2:10 PM
matmarex moved this task from Upcoming to Doing on the Editing-team (Kanban Board) board.

I've imported some pages from pt.wp to my local wiki and I was able to reproduce it. Here's a smaller test case in English: https://en.wikipedia.beta.wmflabs.org/wiki/Talk:T289873

The [reply] link in section B will add the reply directly on the page "Talk:T289873" instead of "Talk:T289873/B".

This happens because the [edit] links generated by the template "T289873-discussion" are treated as part of the first comment in the section, and the reply tool gets confused when detecting which page the comment is transcluded from.

It's a bug in the code that's supposed to prevent comments starting with a template like "{{ping|…}}", or ending with a "unsigned" template rather than a normal signature (T252058), from being marked as template-generated and becoming impossible to reply to using the tool.

I've been working on this on-and-off for the past few days, and I've written some code that seems to work, however:

  1. It took a lot of special-cases and I feel there should be a more elegant way to do it; right now I feel like I don't even understand myself how it works
  2. The fix actually causes the reply tool to not work for replying to the first comment in each section, which might be worse than the current behavior

So I'm going to put it off for a bit and wait for inspiration, or bring it up in the engineering meeting.

I think this dirty diff is caused by the same problem (although in this case, it causes duplication of content from a template): https://en.wikipedia.org/?diff=1056730006 (it was reported by the user at mw.org and also in dtcheck).

In the Parsoid HTML rendering of the old revision (https://en.wikipedia.org/api/rest_v1/page/html/Wikipedia_talk%3ATemplate_documentation/1056728376), the {{block indent}} transclusion range extends to cover the previous paragraph, so the first comment is partially transcluded and partially not. Our code again gets confused and thinks it's not transcluded. When we try to insert the reply in Parsoid HTML, we split the about-group of the transclusion, causing the second half of it (coincidentally the part that's actually coming from the template) to be duplicated, like in T290940, although this is otherwise distinct from that bug.

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

[mediawiki/extensions/DiscussionTools@master] Test case for partially transcluded comment sections

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

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

[mediawiki/extensions/DiscussionTools@master] [WIP] Improve detecting transcluded comments again

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

Change 743523 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Test cases for partially transcluded comments

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

Change 743524 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Improve detecting transcluded comments again

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