Page MenuHomePhabricator

Bundled notifications: The counter for bundled notifications shows sum of notifications of Alerts and Messages.
Closed, ResolvedPublic

Description

Moved from comments on T138888: Cross-wiki counter does not show correct number of unread messages
The counter for cross-wiki bundles (beta-labs) consistently shows the sum of both Alerts and Messages.
e.g. User cawiki has only cross-wiki Alerts and Messages

Screen Shot 2016-06-30 at 11.10.49 AM.png (230×579 px, 35 KB)

Another example
Screen Shot 2016-07-04 at 2.10.06 PM.png (253×585 px, 32 KB)

  1. Expanded Alerts from the first screenshot show 5 new messages on user's talk page and the message that the user's comment was edited several times (unspecified). What was calculated there? The number of multiple edits of the user's comment might be 3 times according to overall badge count or it may be 15-5=10 times according to the sub-panel counter.

Screen Shot 2016-07-04 at 1.24.35 PM.png (472×611 px, 62 KB)

Open Messages (the flyout counter shows 7, the cross-wiki sub-panel counter shows 15 again )

Screen Shot 2016-07-04 at 1.24.43 PM.png (276×594 px, 34 KB)

Expand it - the number of cross-wiki notifications is shown correctly 7(6+1), the same count as in the flyout.

Screen Shot 2016-07-04 at 1.25.01 PM.png (412×621 px, 61 KB)

A simpler example - User:ET91 has 5 events according to db:
3 events in cawiki -

[cawiki]> select event_id, event_type, event_deleted from echo_event join echo_notification on notification_event=event_id where notification_user in (select user_id from user where user_name='ET91');
+----------+------------+---------------+
| event_id | event_type | event_deleted |
+----------+------------+---------------+
|     1279 | welcome    |             0 |
|     1280 | mention    |             0 |
|     1281 | mention    |             0 |
+----------+------------+---------------+
3 rows in set (0.00 sec)

2 events in enwiki -

[enwiki]> select event_id, event_type, event_deleted from echo_event join echo_notification on notification_event=event_id where notification_user in (select user_id from user where user_name='ET91');
+----------+----------------+---------------+
| event_id | event_type     | event_deleted |
+----------+----------------+---------------+
|   307211 | emailuser      |             0 |
|   307316 | flow-new-topic |             0 |
+----------+----------------+---------------+
2 rows in set (0.00 sec)

(CORRECT) Alerts in cawiki will display two Mentions

Screen Shot 2016-06-30 at 3.21.50 PM.png (641×959 px, 190 KB)

Messages will display "Failed to fetch notificaitons" which is filed as T139112: [regression-betalabs] 'Failed to fetch notifications'

Switching to enwiki - cawiki there will have incorrect count:

Screen Shot 2016-06-30 at 3.26.13 PM.png (342×548 px, 45 KB)

Expand cawiki Alerts - two Mentions are here, but apparently 'Welcome' was counted?:

Screen Shot 2016-06-30 at 3.26.22 PM.png (491×537 px, 64 KB)

enwiki Messages - cawiki count is incorrect

Screen Shot 2016-06-30 at 3.30.07 PM.png (342×560 px, 44 KB)

Expand cawiki Messages subpanel - only 'Welcome' is displayed:

Screen Shot 2016-06-30 at 3.30.17 PM.png (454×558 px, 55 KB)

Event Timeline

The screen recording shows a new user ET93 who has only three notifications only on enwiki

  • 'welcome' + 'enable Flow on user talk page' (2 messages)
  • 'change of user rights'(1 alert).

ET93 goes to a foreign wiki (cawiki) to view them as cross-wiki notifications. The cross-wiki notifications are counted together as Alerts(1)+Messages (2) = 3

SBisson triaged this task as High priority.

How to reproduce:

  1. Create a new user
  2. Write on the newly created user's talk page with another user
  3. Now the new user has 1 message (welcome) and 1 alert (edit-user-talk)
  4. Login on a different wiki with the new user
  5. Alert shows 2 foreign alerts (but where you expand there is only 1)
  6. Message shows 2 foreign messages (but when you expand there is only 1)

Change 297509 had a related patch set uploaded (by Mattflaschen):
Notification count: don't assume 'all'

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

Change 297509 merged by jenkins-bot:
Notification count: don't assume 'all'

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

Change 297707 had a related patch set uploaded (by Mattflaschen):
Notification count: don't assume 'all'

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

Change 297707 merged by jenkins-bot:
Notification count: don't assume 'all'

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

Stashbot subscribed.

Mentioned in SAL [2016-07-06T23:41:24Z] <legoktm@tin> Synchronized php-1.28.0-wmf.9/extensions/Echo/: T139321, T139323 (duration: 00m 32s)

Checked the fix in betalabs - the counters display correct numbers.