Page MenuHomePhabricator

Check MassMessages for Linter errors before sending
Closed, ResolvedPublic

Description

Right now, Help:Extenson:MassMessage says that messages are checked for some invalid syntax before they are sent, but messages do not appear to be checked for Linter errors. This leads to situations in which any editor with MassMessage rights can deliver an error-laden message to hundreds or thousands of talk pages, possibly breaking the formatting on those pages and adding to the burden of those who are working to clean up such errors.

Here's an example of a message that went out to over 500 User talk pages with two sets of obsolete center tags.

Can the MassMessage extension be enhanced to check for Linter errors?

Event Timeline

This is still happening:

That message appears to have been sent to over 1,300 User talk pages, if it used the list at https://en.wikipedia.org/wiki/Wikipedia:WikiProject_Women_in_Red/Outreach/List

Each message added one new Linter error to each of those 1,300 pages.

Can someone please work on this?

Core's SignatureValidator::validateSignature() or SignatureValidator::checkLintErrors() could be a starting point, as a place where Parsoid::wikitext2lint() is currently called.

No one owns MassMessage, apparently. :(

Change #1047616 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/extensions/MassMessage@master] [WIP] Check MassMessages for Linter errors

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

Change #1047616 merged by jenkins-bot:

[mediawiki/extensions/MassMessage@master] Check MassMessages for Linter errors

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

ABreault-WMF triaged this task as Medium priority.
ABreault-WMF moved this task from Backlog to To Deploy on the Content-Transform-Team-WIP board.

Right now, Help:Extenson:MassMessage says that messages are checked for some invalid syntax before they are sent

Unfortunately, both of immediate feedback and server side checks were broken in my testing but fixes are up,
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MassMessage/+/1047605
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MassMessage/+/1050462
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MassMessage/+/1050467

Can the MassMessage extension be enhanced to check for Linter errors?

The merged patch adds warnings for Linter errors and should be live in production now,
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MassMessage/+/1047616

but in reading T325727, I'm not sure if the checks apply to the page message or the API calls. Just the body message.

T368690 is opened to refactor the use of a private service.

T325727 can be used to apply the checks more broadly and I imagine there will be calls to improve UI when displaying the lints.

Jonesey95 reopened this task as Open.EditedAug 16 2024, 5:52 PM

When is this fix going to be deployed? This mass message arrived in the past 24 hours with a Linter "bogus image options" error in it:

https://en.wikipedia.org/w/index.php?title=User_talk%3ASaiphani02&diff=1240633307&oldid=1240528681

The fix for that Linter error was this:

https://en.wikipedia.org/w/index.php?title=User_talk:Saiphani02&diff=next&oldid=1240633307

It is deployed but, as mentioned in T358818#9933093, there are two caveats,

  1. From T325727#9932834, these are just warnings. The person sending out the MassMessage is free to ignore them. Preventing them from sending without fixing the issues seemed like too big of a product decision for this task. I imagine not everyone is going to understand how to fix all the issues and, in T358818#9933093, the UI can be improved to highlight what is wrong.
  2. Quoting from the description of T325727, "While unclosed HTML tags are detected for in the content specified in Special:MassMessage, this is not done for the page to be sent as a message." In other words, in this patch, I replaced the ad hoc regular expression checks that existed with the Linter checks. But those checks only apply to the body of the MassMessage and not if you choose to send a page as a message instead (or in addition).

I imagine not everyone is going to understand how to fix all the issues

If they don't understand how fix errors in a mass message they are about to send out, they should ask. There is absolutely no valid reason to let anyone ignore a warning and send an error-ridden message to an unlimited amount of users with a single push of a button.

I would hope and expect that
Wikimedia representatives would be diligent about heeding these warning messages (and about posting messages that use nonexistent templates). This feature request does not appear to have been implemented effectively and is causing volunteer gnomes to have to tidy up after message senders.

I don't see any evidence that the message you posted actually emitted any warning messages. Nonexistant templates is not something presently covered by the Linter (the focus of this task) and given the cross-wiki nature might actually be impossible to detect absent either something like a global template system or banning templates in messages entirely.

That is, I appreciate the fact that a hand needs to be slapped for that particular message, but I don't think this task is appropriate for that complaint.

You should probably open a new task for "mass message warnings should prevent messages from being sent" and/or "template use should cause a warning" if that's what you're asking for; neither of those is covered by this task.

To be clear, in the diff most recently posted by @Jonesey95, what appears to have happened is that on the wiki on which the poster was composing the message Template:langSwitch did exist, and so the linter didn't flag a message, and so there wasn't any warning for the poster to ignore (or not). But after it was posted to a bunch of wikis on which [[Template:langSwitch]] *didn't* exist, it caused a bunch of extra linter errors because when the template doesn't exist we render it as a redlink, and the redlink inside a wikilink caused the linter link-in-link error. Please correct me if my understanding of the situation is incorrect.

As @ssastry has pointed out, Jonesey95's original complaint was more directly caused by an issue which Linter does cover, but I think @Arlolra suggested that the root cause there was that the sender had used the "page to send as a message" feature, and no warnings are displayed if the page to be sent contains errors. So I don't think it's clear in this case that WMF staff ignored a displayed warning either; further discussion of that particular failure cause ought to happen in T325727: Validate wikitext in both page messages and content specified before sending a message which is directly relevant.

This problem is still not fixed (link is to a mass message from 14 September 2024). This message went to 1,293 pages, according to search results!

Can someone please reopen this ticket, or open a new one, to prevent these Linter errors from being sent to hundreds of User Talk pages with the click of a button?