Notifications are not sent when a user mentions another if the signature of the sender contains localized namespaces
Closed, ResolvedPublic

Assigned To
None
Priority
High
Author
He7d3r
Subscribers
liangent, JanWMF, matmarex and 13 others
Projects
Reference
bz53132
Description

If I remove my custom signature from [[pt:Special:Preferences]], and set my gender to unspecified, I'm able to notify another user by making an edit such as
https://pt.wikipedia.org/w/index.php?diff=36719631
But if I change the gender to Male, the user is not notified when I do a similar edit:
https://pt.wikipedia.org/w/index.php?diff=next&oldid=36719631


Version: master
Severity: major
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=66473
https://bugzilla.wikimedia.org/show_bug.cgi?id=71353

bzimport added projects: Echo, I18n.Via ConduitNov 22 2014, 2:04 AM
bzimport added a subscriber: wikibugs-l.
bzimport set Reference to bz53132.
He7d3r created this task.Via LegacyAug 20 2013, 10:28 PM
He7d3r added a comment.Via ConduitAug 20 2013, 10:35 PM

It is also not sent if I use "[[User:" in a custom signature and mention the user again:
https://pt.wikipedia.org/w/index.php?diff=36719696

He7d3r added a comment.Via ConduitAug 20 2013, 10:37 PM

Using "[[Usuário" in the custom signature link (and keeping gender = male) doesn't work either.

He7d3r added a comment.Via ConduitAug 20 2013, 10:39 PM

(In reply to comment #2)

Using "[[Usuário" in the custom signature link (and keeping gender = male)
doesn't work either.

Thata was tested here: https://pt.wikipedia.org/w/index.php?diff=next&oldid=36719696

Using "[[Utilizador:" also doesn't send any notification when I edit:
https://pt.wikipedia.org/w/index.php?diff=next&oldid=36719718

He7d3r added a comment.Via ConduitAug 24 2013, 5:04 PM

I made a more comprehensive set of tests to find out under which circumstances the I'm able to send notifications by mentioning another user:

  • "No gender" makes [[Special:MyPage]] to show the NS alias "Usuário(a)" and:
    • No custom signature: works (this defaults to a signature using "Usuário(a)")
    • Signature using "[[User:": fails
    • Signature using "[[Usuário(a):": works
    • Signature using "[[Usuário:": fails
    • Signature using "[[Usuária:": fails
    • Signature using "[[Utilizador:": fails
  • "Gender = male" makes [[Special:MyPage]] to show the NS alias "Usuário" and:
    • No custom signature: fails
    • Signature using "[[User:": fails
    • Signature using "[[Usuário(a):": works
    • Signature using "[[Usuário:": fails
    • Signature using "[[Usuária:": fails
    • Signature using "[[Utilizador:": fails
  • "Gender = female" makes [[Special:MyPage]] to show the NS alias "Usuária" and:
    • No custom signature: fails
    • Signature using "[[User:": fails
    • Signature using "[[Usuário(a):": works
    • Signature using "[[Usuário:": fails
    • Signature using "[[Usuária:": fails
    • Signature using "[[Utilizador:": fails

FYI: the default file languages/messages/MessagesPt.php[1] has:

$namespaceNames = array(
...
NS_USER => 'Utilizador',
...
);

$namespaceAliases = array(
'Usuário' => NS_USER,
...
);

$namespaceGenderAliases = array(
NS_USER => array( 'male' => 'Utilizador', 'female' => 'Utilizadora' ),
...

);

and currently the file wmf-config/InitialiseSettings.php[2] has the following:

'wgNamespaceAliases' => array(
...
'+ptwiki' => array(

		'Utilizador' => NS_USER,
		...

)
...
)

'wgExtraNamespaces' => array(
...
'ptwiki' => array(

		NS_USER => 'Usuário(a)'
		...

)
...
)

'wgExtraGenderNamespaces' => array(
'default' => array(),
...
'ptwiki' => array(

		NS_USER => array( 'male' => 'Usuário', 'female' => 'Usuária' ),
		...

),
...

)

[1] https://github.com/wikimedia/mediawiki-core/blob/master/languages/messages/MessagesPt.php#L66
[2] https://github.com/wikimedia/operations-mediawiki-config/blob/master/wmf-config/InitialiseSettings.php

matmarex added a comment.Via ConduitAug 24 2013, 5:39 PM

On man, this, like, really sucks.

Relevant function is EchoDiscussionParser::getUserFromLine(), which currently only accepts the canonical localized variants of user namespace, user talk namespace and Special:Contributions.

matmarex added a comment.Via ConduitAug 24 2013, 5:53 PM

It basically needs an entry for ns 2 and 3 in Language#getNamespaces(), an entry for each namespace 2 and 3 alias listed in Language#getNamespaceAliases(), and all that for both English and content language.

matmarex added a comment.Via ConduitAug 24 2013, 5:55 PM

(And probably all aliases for Special:Contributions, too, using SpecialPageFactory::getAliasList().)

matmarex added a comment.Via ConduitAug 24 2013, 6:12 PM

Something like this (untested):

static function getUserFromLine( $line, $timestampPos ) {

global $wgContLang;
// Later entries have a higher precedence
// @todo Handle optional whitespace in links
$possiblePrefixes = array();

foreach ( array( $wgContLang, Language::factory( 'en' ) ) as $language ) {
  $nsNames = $language->getNamespaces();
  $possiblePrefixes[] = '[[' . $nsNames[NS_USER] . ':';
  $possiblePrefixes[] = '[[' . $nsNames[NS_USER_TALK] . ':';

  $nsAliases = $language->getNamespaceAliases();
  foreach ( $nsAliases as $text => $id ) {
    if ( $id == NS_USER || $id == NS_USER_TALK ) {
      $possiblePrefixes[] = '[[' . $text . ':';
    }
  }
}

// @todo Handle possible aliases
$possiblePrefixes[] = '[[' . SpecialPage::getTitleFor( 'Contributions' )->getPrefixedText() . '/';
bzimport added a comment.Via ConduitSep 18 2013, 3:32 AM

bsitu wrote:

Maybe we should just remove the text pattern match for signature, It's unclear to me why it started with the signature requirement from the first place.

Ironholds added a comment.Via ConduitSep 19 2013, 6:37 AM

As opposed to just matching on link? I honestly don't know; Kaldari might?

He7d3r added a comment.Via ConduitSep 20 2013, 10:46 AM

(In reply to comment #9)

Maybe we should just remove the text pattern match for signature, It's
unclear
to me why it started with the signature requirement from the first place.

I believe that would be useful, since it would also make edits such as
https://pt.wikipedia.org/w/index.php?diff=36939646&uselang=en&diffonly=1
to trigger notifications as they should.

Spage added a comment.Via ConduitSep 23 2013, 8:46 PM

Prioritization and scheduling of this bug is tracked on Mingle card https://mingle.corp.wikimedia.org/projects/flow/cards/234

gerritbot added a comment.Via ConduitOct 3 2013, 11:07 PM

Change 87477 had a related patch set uploaded by Legoktm:
Support non-English namespace names in DicussionParser::getUserFromLine

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

Legoktm added a comment.Via ConduitOct 3 2013, 11:08 PM

(In reply to comment #13)

Change 87477 had a related patch set uploaded by Legoktm:
Support non-English namespace names in DicussionParser::getUserFromLine

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

This is basically MatmaRex's patch fixed up a bit by me.

He7d3r added a comment.Via ConduitOct 6 2013, 2:30 PM

For the record, given the current usage of customized signatures on Portuguese Wikipedia[0], there are at least 741 users who are not able to use Echo to mention other users, and previous to a change[1] to our [[pt:MediaWiki:Signature]], the number was over 17000 (female users which didn't customize their signature).

[0] https://pt.wikipedia.org/wiki/Project_talk:Notificações#Dados_de_Prefer.C3.AAncias
[1] https://pt.wikipedia.org/w/index.php?diff=36985689&oldid=27625950

Fabrice_Florin added a comment.Via ConduitOct 9 2013, 4:01 PM

Thank you all for bringing this issue to our attention.

My recommendation would be that we remove the requirement that a signature be included before a mention notification is sent, as stated here:

https://www.mediawiki.org/wiki/Echo/Feature_requirements#User_Mention

When we created this feature, we were being very cautious to not over-spam users, which is why we put in some of these restrictions. But I don't think this particular limitation is needed anymore.

I believe this would be an important bug to fix sooner rather than later, given how many folks are impacted by this restriction.

Thank you for flagging this issue!

Ironholds added a comment.Via ConduitOct 9 2013, 4:25 PM

That would seem to be a Product decision - and one that would involve assigning E2 engineers back to non-critical Echo bugs, to boot - and so Maryana's concern.

Lego/MatmaRex's bug fixes the actual problem here: let's stick with that. If there is a need for a new feature it will both have to wait and have to be approved of/supervised by the Product Manager for the feature.

matmarex added a comment.Via ConduitOct 11 2013, 8:58 AM

This also affects signatures with namespaces with spaces replaced with underscores, like [[User_talk:Matma Rex]].

matmarex added a comment.Via ConduitOct 19 2013, 4:11 PM
  • Bug 55915 has been marked as a duplicate of this bug. ***
Quiddity added a comment.Via ConduitOct 23 2013, 5:59 PM

(In reply to comment #16)

My recommendation would be that we remove the requirement that a signature be
included before a mention notification is sent, as stated here:
[...]

Regarding "remove the requirement that a signature be included before a mention notification is sent", which I'm generally in favour of...

I just saw Bug 54639 ("Echo is not triggering notifications when a mention is made while reorganizing comments in the page") which makes me worry that (if the signature-requirement is taken away) mass notifications will be accidentally sent when threads are shuffled/split/merged or archived.

Just worrying out-loud; I might have understood the details incorrectly.

matmarex added a comment.Via ConduitOct 23 2013, 6:06 PM

Good point. Luckily I think we could easily avoid that issue by just counting the number of mentions for each user in the old and new wikitext and only sending a notification is the number increased.

bzimport added a comment.Via ConduitNov 28 2013, 2:43 PM

Wikifram wrote:

A) I would support the removal of the need to sign a comment before a "ping" works (I wasn't aware of this requirement, and thought that my "ping" remained unanswered until JdForrester nicely explained this to me)

but...

B) I have the habit to archive my talk page by using "copy-paste", I wouldn't want people to get unwanted notifications when I do this though.

I fear that A and B are mutually exclusive requirements...

gerritbot added a comment.Via ConduitDec 18 2013, 1:24 AM

Change 87477 merged by jenkins-bot:
Support non-English namespace names in DiscussionParser::getUserFromLine

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

whym added a comment.Via ConduitJan 11 2014, 9:03 AM

I presume this edit https://ja.wiktionary.org/w/index.php?oldid=617213 should have invoked a notification towards [[User:Whym]], but it didn't.

Quiddity added a comment.Via ConduitJan 12 2014, 8:20 PM

(In reply to comment #24)

I presume this edit https://ja.wiktionary.org/w/index.php?oldid=617213
should
have invoked a notification towards [[User:Whym]], but it didn't.

Confirmed. I've been testing it at jpwikt, and cannot get mention notifications to work. I tried twice with my interface language (for both accounts) set to Japanese, and to English. Neither worked.

gerritbot added a comment.Via ConduitJan 19 2014, 1:56 PM

Change 108329 had a related patch set uploaded by Whym:
(bug 53132) properly get timestamp position in DiscussionParser

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

whym added a comment.Via ConduitJan 22 2014, 1:42 PM

(In reply to comment #26)

Change 108329 had a related patch set uploaded by Whym:
(bug 53132) properly get timestamp position in DiscussionParser

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

Just to put this patch in context: unless this patch is applied, the parser takes timestamp substrings instead of timestamp positions. Languages that put the year at the beginning of the timestamp, substrings as "2013" or "2014" were interpret as the "position". This made some vadility checks fail in the code.

gerritbot added a comment.Via ConduitJan 30 2014, 7:28 AM

Change 108329 had a related patch set uploaded by Legoktm:
Properly get timestamp position in DiscussionParser

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

gerritbot added a comment.Via ConduitJan 30 2014, 7:42 AM

Change 108329 merged by jenkins-bot:
Properly get timestamp position in DiscussionParser

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

Legoktm added a comment.Via ConduitJan 30 2014, 7:46 AM

Patch should go out with 1.23wmf12, which will reach the Japanese Wiktionary on February 4th, and all sites by the 6th. See [[wikitech:Deployments]] for all the details.

Closing for now, please re-open if you notice any other issues related to this bug.

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.