Comment has been collapsed.
Don't ask me, I'm just linking the related announcement.
Comment has been collapsed.
I think I know why. If the user resets his unread messages, then he receives some more new messages but some of the old replies to his messages get deleted, the number gets subtracted from his new messages and the value would be incorrect.
This can be easily solved by also storing in the cache the last reset date and decrementing the cache depending on the last reset date.
So, if the last reset date for userX is an hour ago and userY deletes his reply to userX from yesterday the cache is not decremented for userX. But if the same userY deletes the message he posted as a reply to userX after the last reset date for userX, the cache gets decremented by one for userX.
I'll simply ignore the negligible race condition that can appear due to non-atomic execution.
But, all in all, that fixes the problem without having any overhead.
Comment has been collapsed.
My understanding is cg tried to avoid cross-checking with the db and did it at the cache level. When userX gets a message, the cache field for userX gets incremented by one. When userX marks his messages as read, his unread messages cache field gets reset.
So this bypasses the database completely but only when checking how many unread messages userX has, when the value is taken from cache instead of the database.
Comment has been collapsed.
You might want to post that into the announcement thread
Good idea. Posted a link into the announcement thread as well.
Comment has been collapsed.
So it was a deliberate choice. Thanks for pointing out that thread.
Comment has been collapsed.
And does it really matter that much? I always thought it was kind of useful actually.
Comment has been collapsed.
104 Comments - Last post 43 minutes ago by Tecfan
36 Comments - Last post 53 minutes ago by VicViperV
17,510 Comments - Last post 57 minutes ago by rufioh
1,495 Comments - Last post 1 hour ago by Tecfan
13 Comments - Last post 5 hours ago by intexus
17 Comments - Last post 6 hours ago by Peiperissimus
122 Comments - Last post 10 hours ago by Peiperissimus
350 Comments - Last post 38 minutes ago by Clericust
2,102 Comments - Last post 41 minutes ago by ExcelElmira
20 Comments - Last post 1 hour ago by galiane
2,143 Comments - Last post 1 hour ago by Jztr
59 Comments - Last post 1 hour ago by VoidDroid
1,062 Comments - Last post 1 hour ago by cherrycosmos
128 Comments - Last post 2 hours ago by DanielStoSve
I just noticed a bug on the site.
When someone replies to one of your messages and then deletes the reply, the deleted message won't appear on the messages page (obviously) but it gets taken into consideration for the new messages notification.
Therefore, the displayed number of new messages is wrong because it takes into account the deleted ones too even if they're not available anymore.
Example:
As you can see from the picture, there are only two new messages available, but three new messages reported.
Comment has been collapsed.