Page 1 of 1

Unread posts

PostPosted: Wed Oct 15, 2003 7:28 pm
by Raf
Is it possible that there's a bug in the "new posts since last visit"-feature, or is it I that's buggy? Sometimes I have no new posts, and then other times it gives "new posts" that I've already read. Any ideas, Phil?

PostPosted: Wed Oct 15, 2003 9:50 pm
by phil
I think that there's an issue with the code that updates the record of a user's last visit. This is probably related to the fact that Postnuke has no way of knowing that a session has disconnected. I've just checked my "last visit" timestamp in the database and it shows as about 13:30 today (it's now 22:50).

You may find that the record of your last session is accurate when you've posted, and otherwise not. Let me know if this theory fits. I may or may not try and fix the code, but if I can prove the bug description I may well post it on the support forum.

Cheers

Phil

PostPosted: Fri Oct 17, 2003 1:45 pm
by Raf
Okay, I've logged on a few times now without writing anything. It always showed your post as "new". I'll post this, try again later today and keep you informed.

PostPosted: Fri Oct 17, 2003 3:43 pm
by Raf
Now it showed yours as read, and mine as unread. So it seems to be related to whether you post anything or not.

PostPosted: Fri Oct 17, 2003 7:29 pm
by phil
Yup, as I suspected. I'd checked the code before I came up with that idea. If this problem bothers you, the best short term fix is to logout and stop the site automatically logging you back in every time by unchecking the "remember me" (or whatever it's called) check box.

I'll give this a (little) bit of thought.

PostPosted: Sun Oct 19, 2003 11:21 am
by Sunnyfield
Sounds like a great feature to me: Post each time you visit the forum! :)

PostPosted: Sun Oct 19, 2003 12:43 pm
by Raf
Strangely enough, it also seems to work if somebody else posts.

PostPosted: Mon Oct 20, 2003 3:44 pm
by phil
Hokay, did some research. Found the following which confirms both our findings :
Batpuppy wrote:Ok I "think" I know whats going on here and why it works for some and "seems" to not work for others. The way phpbb2 deletes expired sessions is that when a "registered user" starts a session in phpbb2, it checks to see if their are any expired sessions "for other users" and deletes them. Note that it deletes expired sessions for other users and not for the current user.
So in other words if you make a test forum and make one user and keep on logging in and out with that user, it will probably never delete the expired session for that user and keep using it over and over.
This part of the code was left functioning the same as it does in the standalone phpbb2. Rather this is really a good way to do this or not is another question but we are primarly adapting phpbb2 to work in postnuke as a module and to function much the same as it does as a standalone as far as the forum itself goes.


So the answer is we need more members (until the phpBB people update the code anyway!)

PostPosted: Sun Oct 26, 2003 1:27 pm
by Sunnyfield
I just got logged out. God knows why... After logging in again, all posts were marked read. Even the ones I hadn't read yet. Luckily I alwasy remember what was the last time/date I read messages.

PostPosted: Sat Nov 01, 2003 3:11 pm
by phil
Yup, I think the software just assumes you read everything last time you visited. It's a fairly simple approach. Having "read/unread" status by user for each message is a lot more complicated, even though in database terms it's a simple associative entity resolving the relevant many-many relationship.