Page MenuHomePhabricator

A user received mention notification which he shouldn't have
Closed, ResolvedPublic

Description

A user (@MaxBioHazard) has reported that he has received mention notification which he shouldn't have, following the notification rule "the message cannot contain any other signatures".

It happened after this test edit and is screenshoted here:

pasted_file (204×553 px, 30 KB)

This makes me worry, knowing that when I edit big discussion for testing purposes in my sandbox, users which participated in them may receive notifications.

It is also interesting that both sections named "Комментарии" which, according to the screenshot, must contain link to MaxBioHazard's page, contain no such.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Addshore added a project: WMDE-TechWish.
Addshore moved this task from Proposed to Sprint ready on the WMDE-TechWish board.

So I have done some investigation and it looks like mentions were sent out here.

from echo_event

| event_id | event_type | event_variant | event_agent_id | event_agent_ip | event_page_namespace | event_page_title
| 14863546 | mention    | NULL          |          60281 | NULL           |                 NULL | NULL             |

event_extra can be seen below

array(4) {
  ["content"]=>
  string(3927) "Добавляйте варианты по трафарету выше, свои или из прошлых тем. Обратите внимание на строгие требования по сохранению шрифта (если сохранены надписи) и размерам (135 × 155 пикселей). Никаких "полотен, которые потом ужмём и подрисуем", не предлагать. --[[У:Neolexx|Neolexx]] ([[ОУ:Neolexx|обс.]]) 13:58, 25 декабря 2016 (UTC)


Если в ближайшие пару дней в обсуждении не появятся кандидаты, которые не будут нарушать [[:wmf:Visual identity guidelines|гайдлайны]], а также если не появятся внятные сроки его проведения и сроки нахождения новогоднего логотипа на страницах ВП, то этот предварительный итог становится окончательным, а обсуждение закрывается за отсутствием кандидатов и внятной процедуры замены лого. – [[У:Meiræ|''Meiræ'']] 20:40, 25 декабря 2016 (UTC)
* Этот гайдлайн предназначен для использования вне википедии. «These guidelines aren’t intended to act as rules and regulations for on-wiki activities.» И это гайд, а не правило. С уважением,--[[U:Draa kul|Draa_kul]] <sup>[[UT:Draa kul|talk]]</sup> 21:53, 25 декабря 2016 (UTC)
** Это часть комментария на мете к введению этого гайда в 2011 году, с тех самых пор, однако, в проектах Викимедиа он используется как правило при проведении подобных конкурсов. Кроме, как можно было заметить, рувики. – [[У:Meiræ|''Meiræ'']] 22:14, 25 декабря 2016 (UTC)
*** Приведите доказательства вашим словам. Пока что [[commons:Category:New Year Wikipedia logos|вышеприведённая категория]] свидетельствует об обратном. [[u:MaxBioHazard|MBH]] 10:37, 26 декабря 2016 (UTC)
*** Если даже кем-то и используется, то многими не используется, см. выше. И явно без последствий со стороны Фонда. Значит, нарушать его можно по решению сообщества. Следовательно, любые попытки подведения «итога» на этом основании нелегитимны и наверняка будут откатываться. [[User:AndyVolykhov|'''A'''ndy'''V'''olykhov]] <sup>[[User talk:AndyVolykhov|'''↔''']]</sup> 12:30, 26 декабря 2016 (UTC)
**** {{div-small|1=Почему бы они ''откатывались'' вместо того, чтобы оспариваться? Пойду откачу чей-нибудь итог, потому что у меня есть ''кое-какие соображения о том, почему он нелегитимен''. — ''[[У:Jack who built the house|Джек, который построил дом]]'' ([[ОУ:Jack who built the house|обс.]]) 15:24, 26 декабря 2016 (UTC)}}
***** <small>Ну вначале оспариваться, да. Потом возможна война откатов с заменой «итог» на «оспоренный итог» и обратно. [[User:AndyVolykhov|'''A'''ndy'''V'''olykhov]] <sup>[[User talk:AndyVolykhov|'''↔''']]</sup> 15:33, 26 декабря 2016 (UTC)</small>
****** <small>*Качает головой*"
  ["section-title"]=>
  string(22) "Комментарии"
  ["revid"]=>
  int(82800148)
  ["mentioned-users"]=>
  array(4) {
    [1119637]=>
    int(1119637)
    [706487]=>
    int(706487)
    [529055]=>
    int(529055)
    [8278]=>
    int(8278)
  }
}

And those users are

select user_name from user where user_id in ( 1119637, 706487, 529055, 8278 );
+--------------+
| user_name    |
+--------------+
| AndyVolykhov |
| MaxBioHazard |
| Draa kul     |
| Meiræ        |
+--------------+
4 rows in set (0.00 sec)

After looking through the code I threw up a quick WIP patch that might have something to do with the issue
https://gerrit.wikimedia.org/r/#/c/330163/

I still need another look over all of this!

Also, possibly this may have something to do with the issue which occured recently when a userpage (this one) was included in a page by accident ({{u:User}} was typed instead of {{u|User}} while we have U as an alias for User namespace) and at least one of the users (borodun) had received a mention notification; his nickname with a signature was on that userpage. (Details on Russian are here.)

Addshore moved this task from Back Burner 🏛️ to Watching 👀 on the User-Addshore board.
Addshore subscribed.

With the help of the given diff I could reproduce the error. It seems to be triggered when having massive random changes between two versions including multiple signatures.

In some cases the DiscussionParser tries to make sense out of these changes and interprets them without re-checking for the multiple signatures. I'll start working on a test and fix for it.

Change 337883 had a related patch set uploaded (by WMDE-Fisch):
Avoid unintended mentions when changing content

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

Change 337883 merged by jenkins-bot:
Avoid unintended mentions when changing content

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