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.
385 Comments - Last post 10 minutes ago by sevenweasel
1,736 Comments - Last post 1 hour ago by MBaer
213 Comments - Last post 2 hours ago by looseangel
17,148 Comments - Last post 3 hours ago by pivotalHarry
67 Comments - Last post 3 hours ago by JonathanDoe
15 Comments - Last post 4 hours ago by Fluffster
4 Comments - Last post 5 hours ago by gameboy9725
162 Comments - Last post 1 minute ago by AgainstAllOdds84
1,240 Comments - Last post 28 minutes ago by Tucs
153 Comments - Last post 29 minutes ago by Ad4m
113 Comments - Last post 35 minutes ago by StarPONY
280 Comments - Last post 42 minutes ago by Askelladd
30,539 Comments - Last post 1 hour ago by Yamaraus
152 Comments - Last post 1 hour ago by forseeker
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.