Page MenuHomePhabricator

Cross-wiki counter does not show correct number of unread messages
Closed, ResolvedPublic

Description

i.e. does not take bundle counting into account:

cawiki-collapsed.png (248×514 px, 28 KB)

cawiki-expanded.png (499×519 px, 41 KB)

When collapsed, it says I have 3 messages, but the counter says 5 and when expanded I see two bundles of 2 and one single message, so 5 is the correct number.

Event Timeline

Change 296574 had a related patch set uploaded (by Sbisson):
Fix foreign bundle count

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

Change 296574 merged by jenkins-bot:
Fix foreign bundle count

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

  1. 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 actually 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)

Created 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)

The specific issue described in this task - count correctly bundled messages in cross-wiki counter - has been fixed, e.g. Cross-wiki sub-panel shows 6 messages from 3 wikis:
ruwiki - 3 msgs
enwiki - 2 msgs
metawiki - 1 msg
They counted correctly by the cross-wiki counter as 6 msgs

Screen Shot 2016-07-04 at 5.57.35 PM.png (248×549 px, 41 KB)

Screen Shot 2016-07-04 at 5.57.20 PM.png (521×626 px, 86 KB)