Page MenuHomePhabricator

User preferences: Check raw signature for linter errors
Open, NormalPublic

Description

A user can enter a custom "raw" signature in their preferences.

The linter should run on this field and at least indicate that the signature is not good enough.

Following that, the system might either prevent the user from saving his preferences, or ignore the custom signature in favor of the default system signature until such time as the raw signature passes the linter check.

Might possibly use the work in T163091: Parsoid: Add API endpoint to get lint errors for arbitrary wikitext.

Event Timeline

Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptJul 18 2016, 12:11 PM
Perhelion renamed this task from User preferences: Check raw signature for deprecated HTML tags. to User preferences: Check raw signature for deprecated self-closed HTML tags..Jul 18 2016, 12:12 PM
Perhelion updated the task description. (Show Details)
He7d3r added a subscriber: He7d3r.Jan 12 2017, 12:24 PM

If custom signature contains deprecated self-closed HTML tags (or even just deprecated HTML tags) then mediawiki should ignore the custom signature and just use the default one.

Izno added a subscriber: Izno.Aug 3 2017, 4:14 PM

If custom signature contains deprecated self-closed HTML tags (or even just deprecated HTML tags) then mediawiki should ignore the custom signature and just use the default one.

We should at least indicate to the user that his signature is not good enough, and why. I am not sure I agree that the custom signature should be ignored, but that wouldn't grieve me too much.

Anything in the signature that causes Lint errors (Special:LintErrors) such as

Self-closed tags
Misnested tags
Missing end tag
Obsolete HTML tags
Stripped tags

Should mean that the custom signature does not get used.

Izno renamed this task from User preferences: Check raw signature for deprecated self-closed HTML tags. to User preferences: Check raw signature for linter errors.Sep 7 2017, 9:44 PM
Izno updated the task description. (Show Details)
Izno updated the task description. (Show Details)Sep 7 2017, 9:48 PM

On the other hand, signatures being broken is not A Big Deal IMO (for a number of reasons). If people use <font>...</font>, or are using a self-closed tag for some reason (why would someone do that in a signature?) and find that they aren't getting the effect they want after signing something for the first time, they'll ask for help fixing it, at which point we can tell them that <font>...</font> is broken.

Izno updated the task description. (Show Details)Sep 7 2017, 9:50 PM
Elitre added a subscriber: ssastry.Sep 8 2017, 11:00 AM
ssastry triaged this task as Normal priority.Sep 8 2017, 4:47 PM
DMacks added a subscriber: DMacks.Sep 25 2017, 4:40 AM

Some broken signatures are now triggering [[Special:LintErrors]], including "high priority" ones. If it's a prolific talk-page user, that means lots of talkpages and other discussion namespaces get flagged. See for example [[:en:User talk:Milonica#Signature HTML bug]]. I don't know how much of a Big Deal lint errors are, but given they're called "high priority errors", it seems important.

bearND added a subscriber: bearND.Sep 29 2017, 2:18 AM

There's also a bot signature triggering lots of Special:LintErrors/html5-misnesting issues. Example: Talk:The_Station_nightclub_fire.
My theory is that a majority of pages showing up in the lint error list that are listed twice (once because of sup and then span) are from this bot. If we can get the signatures fixed then we can stem the flood of new lint errors of that kind.

There's also a bot signature triggering lots of Special:LintErrors/html5-misnesting issues. Example: Talk:The_Station_nightclub_fire.
My theory is that a majority of pages showing up in the lint error list that are listed twice (once because of sup and then span) are from this bot. If we can get the signatures fixed then we can stem the flood of new lint errors of that kind.

That signature should be fixed for sure.

But, that apart, https://gerrit.wikimedia.org/r/#/c/381382 should take care of fixing false positives for the html5-misnesting category. Once that patch is deployed and we clear out the false positives from the database, all these instances will go back to being missing-end-tag errors (which are less severe and don't impact Tidy removal).

I've asked at Wikipedia:Bot requests if anyone can help fix those particular errors.

Nihlus added a subscriber: Nihlus.Sep 30 2017, 4:03 AM

FWIW, I am currently fixing Cyberbot II's signatures.

Fixing Cyberbot III's signatures is flagging up people's watchlists. Considering that all of the bot signatures that may carry the error are over a year old, the desire to tidy up these low level potential errors should be balanced against the disturbance to article watchers who go to check out what has happened. As the Cyberbot III messages are old and no longer essential, if the signature does fail at some point in the future, that is not going to cause users a problem, and any such errors can be fixed by a bot at that time.

Legoktm added a subscriber: Legoktm.Oct 1 2017, 7:47 AM

Fixing Cyberbot III's signatures is flagging up people's watchlists. Considering that all of the bot signatures that may carry the error are over a year old, the desire to tidy up these low level potential errors should be balanced against the disturbance to article watchers who go to check out what has happened. As the Cyberbot III messages are old and no longer essential, if the signature does fail at some point in the future, that is not going to cause users a problem, and any such errors can be fixed by a bot at that time.

I think there was a little bit of confusion on en.wp about the priority of fixing the signatures - I started a thread at https://en.wikipedia.org/wiki/Wikipedia:Bots/Noticeboard#NihlusBOT_2 if you want to comment there.

It would be great to have this feature request addressed. People are still able to add high-priority Linter errors to talk pages with every signature that they add. Here's an example from the last 24 hours: https://en.wikipedia.org/w/index.php?title=User_talk%3AMosrod&type=revision&diff=881456280&oldid=881435006

I favor WOSlinker's idea of ignoring or failing to save custom signature code if it has Linter errors. That will limit the increase in Linter errors on discussion pages and reduce the complaints about bots and gnomes fixing up discussion pages later.

Please increase the priority of this fix. Signatures are still causing Linter errors. Here's a two-day-old one that I just fixed:

https://en.wikipedia.org/w/index.php?title=Template%3ADid_you_know_nominations%2FOlivia_Jade_Giannulli&type=revision&diff=889751112&oldid=889663186

It is unlikely that we will ever catch up with de-Linting talk pages if this feature request continues to be ignored.

Jonesey95 added a comment.EditedApr 10 2019, 8:16 PM

Still happening as of April 5:

https://en.wikipedia.org/w/index.php?title=Template%3ADid_you_know_nominations%2FMe_Too_%28Meghan_Trainor_song%29_%282nd_nomination%29&type=revision&diff=891032343&oldid=890998262

Please increase the priority of this fix. This bug report is almost three years old. Tens or hundreds of thousands of unnecessary Linter errors have been created since then.

Retro added a subscriber: Retro.Jun 3 2019, 4:21 PM

@Jonesey95

I think we're well past the point of easily catching up on en.WP at least. But for dealing with the current problem, I think if we identify the signatures that are problematic, we can use a bot to do a one-time run for each username (after ensuring the user has received a message to change their username if they haven't already changed their username). Of course, this doesn't solve the long-term problem, but it does at least allow more systematic handling of prior problematic content (and a new signature filter wouldn't fix previous mistakes).

I welcome bot fixes of Linter errors in signatures. They will not fix the root cause of the problem, however, which is that custom signature code is allowed to contain Linter errors. @WOSlinker proposed a reasonable fix above.

I haven't seen a lot of action from the WMF coders on Linter error prevention yet; I know they have thousands of bugs and feature requests to contend with, and unless something is actively broken, it probably won't get much attention. I think we'll just have to wait until this problem is viewed as a high priority by someone with the ability to do something about it. In the meantime, I'll keep on gnoming.

Retro added a comment.EditedJun 5 2019, 11:19 PM

They will not fix the root cause of the problem, however[.]

That's true, but I think both parts of the problem need to be taken into consideration when determining the best course of action. @WOSlinker's suggested signature validation checks would be ideal, but if they take a while to get implemented (or are never implemented), we'll have to come up with our own active solutions in the meantime. Bots that fix all of the prior cases may also be able to help editors with newly switched misformatted signatures correct the formatting errors (perhaps à la BracketBot). Then again, it might be better to approach such issues with a more personal touch.

I will also note I did not notice T178879 at the time, and my comments are probably more relevant for that task; further discussion about bots should probably go to that task.

Here's my proposal:

  • First we have a server-side script iterate through each user with a custom signature, check for lint errors after PST (expand templates, etc.). If there are lint errors, start making a list of the wiki/username/error code. Depending on the number of users affected, we can decide whether the later steps are worth it.
  • Add a widget to do validation of signature on Special:Preferences, and reject new signatures that have lint errors.
  • Start messaging listed users that their signature has lint errors and needs to be updated (and links to help pages, etc.)
  • After some pre-determined amount of time, users whose signatures still have lint errors are reset to the default signature.

Does that seem reasonable? Anything I missed or overlooked?

Re: Retro's comments: There is already a bot working through a limited set of signatures. See https://en.wikipedia.org/wiki/Wikipedia:Bots/Requests_for_approval/Ahechtbot_5 and its siblings. The current BRFA process, and the time-consuming nature of finding faulty signatures in talk pages and figuring out a fix for each one, makes it pretty slow to chip away at faulty signatures, but it is possible.

Re: Legoktm: That proposal looks good to me. We should include a field in the report that shows the most recent contribution date for each affected editor. Editors who haven't contributed for some period of time could optionally be excluded from the messaging, and come back to find their custom signatures reset.

Retro added a comment.EditedJun 7 2019, 1:45 PM

Thanks for the link, @Jonesey95. That was exactly the type of bot task I envisioned. I've also been accumulating my own list of faulty signatures in a similar manner, so perhaps they could be added to the next BRFA.

Theoretically, it seems like it should be possible to automate suggested fixes so they don't have to be constructed by hand. There's definitely not a canonical fixed form for every case, but there's probably some patterns that could be easy to correct. This could be used both to speed up the fixing process and possibly integrated into the signature preferences validation tool (of course the feasibility of such integration depends on a variety of other factors).

Regarding filtering out people who haven't contributed for some period of time, I don't see the point of excluding them from the messaging. If they never edit the wiki again, no harm done, but if they come back, it's a useful extra reminder when their sig doesn't match what they expect. Also, if we're notifying people and we come up with a fix anyway, why not tell them about it (and possibly fix it for them in their preferences, as opposed to reverting to the default sig)?

  • Add a widget to do validation of signature on Special:Preferences, and reject new signatures that have lint errors.

While it is needed to check a signature when saving in Special:Preferences, there is also a need to check when posting on a talk page as the signature can contain a template which could be changed after the saving on Special:Preferences has occured.

Retro added a comment.Jun 19 2019, 9:22 PM
  • Add a widget to do validation of signature on Special:Preferences, and reject new signatures that have lint errors.

While it is needed to check a signature when saving in Special:Preferences, there is also a need to check when posting on a talk page as the signature can contain a template which could be changed after the saving on Special:Preferences has occured.

@WOSlinker That's true... but templates are heavily discouraged in signatures for that very reason (at least on en.WP). Currently, if you try to insert a template into your signature, the signature validation will automatically prefix it with subst:. Perhaps a more straightforward solution is just to entirely disallow templates from signatures, and automatically substitute the actual template's contents, instead of prefixing the template transclusion link with subst:.

I suppose the signature could be validated on every single edit, but it seems like that would unnecessarily waste processor time. But my performance concern may be unwarranted.

Snaevar added a subscriber: Snaevar.Jul 7 2019, 8:28 PM