Page MenuHomePhabricator

Notifications counter is incorrect after 'Mark all as read' was clicked for cross-wiki notifications
Closed, ResolvedPublic

Description

Observed in 1.29.0-wmf.3 and 1.29.0-wmf.4

There is a correlation (suggested by @Catrope) between the number of wikis from which notifications are displayed and the frequency of the issue - the more wikis are present in the Notification panel, the more likely the bug will be present.

  1. Login as a user who has cross-wiki unseen notifications.
  2. Open the notification panel and click on the blue dot to mark all cross-wiki notificaitons as read.
  3. The counter will still display 1 (no, it's not the case when there are more than 25 unseen notifications).

In the screen recording, the number of Alerts is 9. Upon opening the Notification panel correctly displays 9 alerts from different wikis. Clicking on the blue dot, incorrectly reduces the counter number to 1.

Note: For some reason, the issue is easier to reproduce in production than in betalabs.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 22 2016, 8:22 PM

If you click on the 'message' icon again, is there a notification? Is it possible that you received a new one almost at the same time?

Etonkovidova added a comment.EditedNov 22 2016, 8:33 PM

If you click on the 'message' icon again, is there a notification? Is it possible that you received a new one almost at the same time?

Nope. The counter seems to be off by 1.

Etonkovidova updated the task description. (Show Details)Nov 22 2016, 8:34 PM

I tried locally but I couldn't reproduce the issue.

I tried locally but I couldn't reproduce the issue.

Yes, it's a problem - not consistently reproducible. I am still checking.

Etonkovidova added a comment.EditedNov 23 2016, 12:39 AM

Checked in beta - the issue is reproducible when

  • The unread notifications are not new. At least, I did not see the issue with newly created notifications.
  • The number of unread notifications should be more than one.
  • Do not expand notification panel for a cross-wiki bundle - immediately click on the blue button to mark all as read.

The two attached screen recording are from betalabs.

From zhwiki - shows that Alerts=1 can be successfully marked as read; the Notices=3 after being marked as read display the count of 2 and on expanding no notificaitons are shown.


Second screen recording shows the case when there are >25 Notices.

Aklapper renamed this task from [regression 1.29.0-wmf.3] The Notificaitons counter is incorrect after 'Mark all as read' was clicked for cross-wiki notifications to [regression 1.29.0-wmf.3] Notifications counter is incorrect after 'Mark all as read' was clicked for cross-wiki notifications.Nov 23 2016, 2:10 PM
Aklapper added a project: Notifications.

Adding actual code project as I assume this is about the Notifications codebase.

Etonkovidova added a comment.EditedNov 29 2016, 7:15 PM

Re-opened the issue after more testing in 1.29.0-wmf.4

Etonkovidova closed this task as Resolved.Nov 29 2016, 7:15 PM
Etonkovidova reopened this task as Open.Dec 2 2016, 9:50 PM
Etonkovidova updated the task description. (Show Details)
Etonkovidova added a subscriber: Catrope.
SBisson renamed this task from [regression 1.29.0-wmf.3] Notifications counter is incorrect after 'Mark all as read' was clicked for cross-wiki notifications to Notifications counter is incorrect after 'Mark all as read' was clicked for cross-wiki notifications.Dec 6 2016, 4:24 PM
SBisson removed a project: Regression.

For future reference, notifications can be generated in 6 foreign wikis in mw-vagrant using the following command:

for w in en fr es zh ru he; do mwscript extensions/Echo/maintenance/generateSampleNotifications.php --wiki ${w}wiki -f -a Admin -o Admin -u <username> -t welcome; done

<username> should be replaced by the name of a user that exists in all those wikis.

Change 326023 had a related patch set uploaded (by Sbisson):
Fix unread notification count caching

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

Change 326023 merged by jenkins-bot:
Fix unread notification count caching

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

Checked the fix in betalabs. Need to check after WMF-deploy-2016-12-13_(1.29.0-wmf.6).

jmatazzoni closed this task as Resolved.Dec 14 2016, 7:34 PM