Always unread

Posted by Worstje on Sat 03 Oct 2009 10:16 AM — 22 posts, 99,875 views.

Netherlands #0
I replied to http://www.gammon.com.au/forum/?id=9767&page=999 a few hours back.

But no matter how many times I view it, refresh, log out, clear cache, log in etc, it will ALWAYS list that topic as 'unread' on the main page for me. Maybe it will fix once I post (and perhaps view this post again), but either way, this is a quirk it never ever showed before.

Edit: Nope. Now I have two posts that are always unread. Heh.
Amended on Sat 03 Oct 2009 10:17 AM by Worstje
Australia Forum Administrator #1
It has always worked like that. It does not record, per user, which posts you have read. To do that, it would need to record, for all 55,603 threads (at present), for each of 4,905 users (at present) whether or not each one has read a particular thread. That is, 55603 * 4905 = 272,732,715 database records to do that.

What it does is record, on your user database entry the *latest* post you read, and update the list of posts accordingly (shown as read or unread).

However there is one exception, which you noted. It doesn't count, if you read your own post. Why? Well, if you have (say) 5 unread posts. You read the first unread one, so it looks like this:


a
b
c
d
---------- 
e 


The "read" marker now is between d and e, because you read e.

However if you now reply to e, with post r1, it looks like this:


r1   (your reply)
a
b
c
d
---------- 
e 


However note that r1 is not marked as read, because if it was, it would also look like a, b, c and d were also read (which they weren't).

So, if you replied to all 5 posts (which I often do), I then see:


r1 
r2
r3
r4
r5
---------- 
a
b
c
d
e 


So, effectively my own posts are marked as unread, although obviously I don't need to read something I wrote myself, so I don't worry about it too much. Later on, another post from someone else, which I read, effectively moves the marker up, so all posts are now read.
Amended on Sat 03 Oct 2009 10:07 PM by Nick Gammon
Netherlands #2
I am pretty sure that in the past, whenever I would read my own post, it would update the bar upto that point. Your method doesn't work for me, since rather than 'posts', I see discussions. And the fact I was the last one to reply is a detail I don't care about - in my mind, having them above the line implies I haven't read the topics at all, and I am tempted to reclick them next time I visit 'just to make sure'.

It's all inbetween them ears. :)
Australia Forum Administrator #3
If, above the line, you see a thread, and the last person to reply was you, then I think you can assume you don't need to read it again. The behaviour hasn't changed.
Australia Forum Administrator #4

After replying to a couple of messages, and even after re-reading my replies, I see this:

That is what I expect to see (my own posts seem unread) - it has always done that. The fact that the unread ones are by Nick Gammon means that the artefact I described has happened - I don't need to read them again, the last person in the threads in question is me.

USA #5
I've actually grown accustomed to the behavior, and it causes me to re-read my replies frequently, which inevitably shows some typos I've made... :)
Netherlands #6
And yet, Nick, one other reply of yours is right below the line. Either they all go below the line, or they all go above the line. ;)

The current behaviour is plain odd imo. That opinion of mine will never change! :)
Australia Forum Administrator #7
In the graphic, after 8:11 am, someone must have posted a couple of more points to the other theads. I read them, and since that person was not me, it updated the "last post read" number. Thus, posts after 8:11 am were marked read (in this thread's case at around 9 am by you, Worstje). Then I replied to a couple of them at about 10:38 am. These replies (since they were by me) are not counted.

However I state again, that I know I don't need to go back and read them again, as my name appears as the last poster.

So basically, "above the line" you skim and see if any posts are there by a person other than yourself, in which case you need to read them.

You haven't explained how I might "fix" this - apart from maintaining a table of over 272,732,715 entries, which would not only be large, but have to be constantly updated, and checked, as people read forum posts.
USA #8
For the record, I haven't had any issues with the 'unread posts line'.

I wonder how other forums handle this. There are several forum packages that track things on a per-thread basis; do you suppose they keep an entire record of the threads you've read? Probably not, because as you point out, that would be rather prohibitive.

I think that it would be better, storage-wise, to turn things around and store the posts you haven't read. You would have a timestamp of last visit, and at the next visit, update that list with all active threads since that timestamp.

This way, you only store unread posts, although certainly the update mechanism is more complicated.

The main thing I don't like about the current global solution is that occasionally I want to skip certain posts I know will be quick to read, but am not ready to read a post I know will take longer to read and/or reply to. So occasionally, I need to let several threads pile up.
Australia Forum Administrator #9
Well, to keep track of *unread* posts, every time a new post was made, you would have to add 4,905 records (at present), for maybe 3 or 4 posts a day. This would significantly add to the time to make a post. A problem too is that a lot of users may be dormant.

I'm not sure how other forums handle it - maybe a cookie or something? Even then there is potentially a lot of information you need to store.

I know the current system is slightly annoying however I am not sure that the cure is not worse than the disease, If someone can outline a sensible way of doing it I would be pleased to hear it.
Australia Forum Administrator #10
See:

http://en.wikipedia.org/wiki/Comparison_of_Internet_forum_software

and scroll down to: "Unread message tracking".
Australia Forum Administrator #11
I'm not sure how what they describe there works, possible the "Session" system creates a small number of database records of the unread posts of that session, rather than the thousands of posts that might exist.
USA #12
Nick Gammon said:
Well, to keep track of *unread* posts, every time a new post was made, you would have to add 4,905 records (at present), for maybe 3 or 4 posts a day. This would significantly add to the time to make a post. A problem too is that a lot of users may be dormant.

Sorry, I must not have phrased my idea correctly... what I meant is that you don't need to track it at the time the post is made, but rather, you can keep track of the last time you synchronized a given user with the unread post list. Then, when the user next visits the site, you update their unread post list with all posts made since their last sync time.

For example:

David's last time sync: Oct 4th. Currently unread: threads 2, 3.
On Oct 5th: David doesn't visit. Thread 1 gets an update, thread 4 is created. (Nothing happens to David's unread post list.)
On Oct 6th: David visits.
- posts made since Oct 4th (time of last sync): threads 1, 4.
- threads 1,4 added to unread list. Current unread list: 1,2,3,4.


This way, you have several advantages:
- You store nothing for dormant users.
- You don't delay individual posts.
- The cost of synchronizing the post list is probably relatively small: you're already doing (almost) exactly that, in some sense, with the current method. Just now, you'd be adding the posts to a list somewhere.

You can store the "last visit" as a cookie, a database field, whatever. (I'd actually prefer the database field, so that it persists across all of my login sessions.)

You would probably want a "mark all posts read" button or something so that somebody can just wipe out the entire list. Maybe "mark posts read" per forum section, too.

Does that make more sense?
USA #13
I was thinking of something more like storing the timestamp of their last visit, and just querying the database for all topics more recent than that. There would be no storing of separate "recent thread" lists per-user, just database queries based on time.

Sort of skimmed most of this thread, so if this isn't relevant, ignore me.
USA #14
What you described, Twisol, is what the forum already does, right?
USA #15
*shrug* I thought Nick said it recorded the last post you read, not the last time you visited
USA #16
Oh, sorry, I misunderstood what you said. Yes, it works on the last post you read. FWIW, I wouldn't want it to be based on last visit, because that would mean I couldn't scan the post list without all of them being marked as read.
USA #17
Fair point. Maybe instead of changing how it works, he can just add a "Mark All As Read" button?
Australia Forum Administrator #18
I suppose I could to that, which would just update the time of the last read post, effectively moving the "read/unread" line upwards.

As for the other ideas, I'm not sure how that would work. For one thing, how do you define a "session"? Especially if you are logged in at multiple PCs.
USA #19
Nick Gammon said:
For one thing, how do you define a "session"?

I'm not sure which session you're referring to? My proposal was to tie it to the user forum-side. Whenever you visit the forum (or just the post list) your (forum-stored) list of unread posts is refreshed w.r.t. your previous visit of that page. It doesn't really depend on any given login session.
Australia Forum Administrator #20
David Haley said:

It doesn't really depend on any given login session.


Well, it does. If you visit the forum, it has to know that David has read a post and not, say, Twisol. Now since the forum now allows for multiple sessions, would you want it to record across all sessions (ie. the reading is done by David, and is not specific to a PC?).

Now to quote from the Wikipedia page earlier:

Wikipedia said:

Session — when a user's session starts, this method relies on the user's "last visit time" to display all messages created since that date as unread. Everything that was posted before "last visit time" is considered "read" regardless of whether the user has actually seen it or not. Until the user's session expires, this method properly tracks read/unread messages, starting with messages that were selected as "unread" when the user's session started.


So we need to establish "when a user's session starts" - is this when you login a particular PC? What if you have multiple logins? If it is a particular PC (that is, the session starts at one PC), then reading some messages at work, they still stay unread at home.

Then it says "Everything that was posted before 'last visit time' is considered "read" regardless of whether the user has actually seen it or not." . That seems worse behaviour than we currently have. In other words, if you log out at work, and then log in at home, everything is considered read. I would say that is a step backwards to the present system.

I still don't see an easy way of implementing it.



USA #21
Oh, sorry. I thought you meant several login sessions of one user, as opposed to individual users. I would imagine that reading should be done on a per-user basis, not a per-PC basis.

I don't think that what the wikipedia section you quoted is a good proposal, to be honest, because I agree that it would be taking a step backwards.

Just to be clear, I don't think multiple logins really factor into this any more than they do for the current last-read-post time keeping.