Last modified: 2014-09-26 12:08:42 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T55132, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 53132 - Notifications are not sent when a user mentions another if the signature of the sender contains localized namespaces
Notifications are not sent when a user mentions another if the signature of t...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Echo (Other open bugs)
master
All All
: High major with 3 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
: i18n
: 55915 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-20 22:28 UTC by Helder
Modified: 2014-09-26 12:08 UTC (History)
18 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Helder 2013-08-20 22:28:28 UTC
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
Comment 1 Helder 2013-08-20 22:35:05 UTC
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
Comment 2 Helder 2013-08-20 22:37:08 UTC
Using "[[Usuário" in the custom signature link (and keeping gender = male) doesn't work either.
Comment 3 Helder 2013-08-20 22:39:27 UTC
(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
Comment 4 Helder 2013-08-24 17:04:15 UTC
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
Comment 5 Bartosz Dziewoński 2013-08-24 17:39:19 UTC
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.
Comment 6 Bartosz Dziewoński 2013-08-24 17:53:25 UTC
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.
Comment 7 Bartosz Dziewoński 2013-08-24 17:55:24 UTC
(And probably all aliases for Special:Contributions, too, using SpecialPageFactory::getAliasList().)
Comment 8 Bartosz Dziewoński 2013-08-24 18:12:56 UTC
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() . '/';
Comment 9 bsitu 2013-09-18 03:32:32 UTC
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.
Comment 10 Oliver Keyes 2013-09-19 06:37:23 UTC
As opposed to just matching on link? I honestly don't know; Kaldari might?
Comment 11 Helder 2013-09-20 10:46:27 UTC
(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.
Comment 12 spage 2013-09-23 20:46:53 UTC
Prioritization and scheduling of this bug is tracked on Mingle card https://mingle.corp.wikimedia.org/projects/flow/cards/234
Comment 13 Gerrit Notification Bot 2013-10-03 23:07:11 UTC
Change 87477 had a related patch set uploaded by Legoktm:
Support non-English namespace names in DicussionParser::getUserFromLine

https://gerrit.wikimedia.org/r/87477
Comment 14 Kunal Mehta (Legoktm) 2013-10-03 23:08:27 UTC
(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.
Comment 15 Helder 2013-10-06 14:30:02 UTC
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
Comment 16 Fabrice Florin 2013-10-09 16:01:29 UTC
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!
Comment 17 Oliver Keyes 2013-10-09 16:25:10 UTC
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.
Comment 18 Bartosz Dziewoński 2013-10-11 08:58:32 UTC
This also affects signatures with namespaces with spaces replaced with underscores, like [[User_talk:Matma Rex]].
Comment 19 Bartosz Dziewoński 2013-10-19 16:11:24 UTC
*** Bug 55915 has been marked as a duplicate of this bug. ***
Comment 20 Quiddity 2013-10-23 17:59:01 UTC
(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.
Comment 21 Bartosz Dziewoński 2013-10-23 18:06:03 UTC
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.
Comment 22 Wikifram@gmail.com (Account disabled) 2013-11-28 14:43:44 UTC
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...
Comment 23 Gerrit Notification Bot 2013-12-18 01:24:31 UTC
Change 87477 merged by jenkins-bot:
Support non-English namespace names in DiscussionParser::getUserFromLine

https://gerrit.wikimedia.org/r/87477
Comment 24 Yusuke Matsubara 2014-01-11 09:03:20 UTC
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.
Comment 25 Quiddity 2014-01-12 20:20:38 UTC
(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.
Comment 26 Gerrit Notification Bot 2014-01-19 13:56:13 UTC
Change 108329 had a related patch set uploaded by Whym:
(bug 53132) properly get timestamp position in DiscussionParser

https://gerrit.wikimedia.org/r/108329
Comment 27 Yusuke Matsubara 2014-01-22 13:42:21 UTC
(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.
Comment 28 Gerrit Notification Bot 2014-01-30 07:28:54 UTC
Change 108329 had a related patch set uploaded by Legoktm:
Properly get timestamp position in DiscussionParser

https://gerrit.wikimedia.org/r/108329
Comment 29 Gerrit Notification Bot 2014-01-30 07:42:54 UTC
Change 108329 merged by jenkins-bot:
Properly get timestamp position in DiscussionParser

https://gerrit.wikimedia.org/r/108329
Comment 30 Kunal Mehta (Legoktm) 2014-01-30 07:46:03 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links