-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Mark All As Read doesn't really #1353
Comments
For scalability purposes, the "Unread" page only checks unread from the past 30 days. This was done for scalability purposes (otherwise if you had no unread, we'd check every single topic for read state). Mark All As Read does the same I believe... calls |
Alternatively, save the last time the button was pressed and don't return
|
Dammit psycho that's what I was going to suggest. :p I think it could work. |
@psychobunny that's sort of what I'm thinking. Looking through the code, the storage of this seems a little strange at the moment, as it's thread -> user mappings, rather that user -> thread mappings. I think change the internal storage of this might make things nicer. But then again, my eyes are getting a little blurry and it's 3am. If we stored the unread state for threads as a a list per user, then we could just truncate that list. However, that means you're stored 0-M values in N lists, where M is the number of threads on in total on the forum, and N is the number of users. That's a lot of duplicate data. However, we can save on that data by for each user, also storing the last time they pressed Mark All As Read, if it's nil, then we can assume that they've never read anything, in which case, they don't need a list of unread topics. We just give them all the topics. I think the inversed mapping is the way to go, unless there's a deeper reason for it being this way? |
Yeah reversing the mapping makes it complicated when someone makes a new post to a topic and you have to mark that topic as unread for all users. You would have to go through all users and add the topic to their unread list. Right now it is just a single command to clear the read by uid set. Also see #1090. Before it was marking everything maybe we can revert back to that. |
What about if we stored both? (I guess that could lead to consistency problems unless implemented with MULTI/EXEC or Transactions.) |
When on: https://community.nodebb.org/unread
I have 20+ unread threads, I click Mark All As Read, then reload the page, to see yet more unread items.
The text was updated successfully, but these errors were encountered: