Page MenuHomePhabricator

"new messages" count not updating when marking some messages as read
Closed, ResolvedPublic

Description

On mediawiki.org I have several threads watched of some discussions in Project:Support_desk. When marking some of them as read, the number of "new message" in personal tools is not decreasing, even if I open another page or several pages on the same wiki. But when I load Special:NewMessages again (by clicking on the New Messages link) then the number is refreshed, displaying the real number of messages, and if I navigate to other pages on the wiki, the number stays correct as it should be.

I can reproduce it consistently.

But it seems it doesn't happen with some other discussions.

For example, I have 2 different threads with 1 new message on each from Project:Support_desk, and 1 thread with 1 new message from another page:

  • New messages count = 3
  • Marking as read one from Project:Support_desk, New messages count stay at 3 (wrong!)
  • Marking as read one from another page, New messages count decreases to 2
  • I navigate to other pages on the wiki, New messages count stay at 2.
  • I go to Special:NewMessages again, and New messages count goes to 1 (correct!).
  • I navigate to other pages on the wiki, New messages count stay at 1.

Maybe the count isn't decreased when there are still new messages from other threads of the same page?

I'll wait until I got some more testing and will update the bug accordingly.


Version: master
Severity: minor
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=46838

Details

Reference
bz46388

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:35 AM
bzimport set Reference to bz46388.

This should have gotten fixed ~four weeks ago in bug 24292 by Krenair.
CC'ing Krenair.

Ok, I think I've found the pattern now.

Whenever I mark a message as read, the number of pending messages is set to the real number of messages plus one. It doesn't matter if they're threads of the same page or not. And it seems like a caching issue on the server, not the client.

For example, having 4 new messages, marking one as read, the api call returns 4 messages pending. Marking another one as read returns 3, and so on. The thing is that the counter is cached in the server somewhere because navigating to other pages maintains the counter at one above the real number. Accessing Special:NewMessages again refreshes the counter to the real number.

Maybe after marking as read, the message count is read from a slave server that hasn't been updated already, and then that (wrong) result is cached again?

It is indeed being read from a slave server... Which would explain why this didn't show up in testing.

Related URL: https://gerrit.wikimedia.org/r/57930 (Gerrit Change I3b3dc98bd1dc6cba44a1c8dfdeba745c523a2086)

Gerrit change 57930 merged, and now it works. Thanks!