When I create a new post it appears as read, when I then shut down my browser (and make sure I clear the session cookie), and log in again my own post appears as unread.
This does not happen when I try the same thing on the jforum.net JForum installation, so I'm assuming this is happening due to the fact that I'm using SSO.
Reading through the code I see that a message is read if:
- User.getLastVisit is later than the post time
- The message is marked as read in 2 maps on the users session
As far as I can see the maps are cleared everytime a session is created so I suspect the problem is in the getLastVisit time. I can see in the database of my installation that it is never updated, and as far as I can see in code it is only written to the database when UserDAO.update is called, which is only called when a user changes his profile. In the UserAction the last visit time is set on login, but as far as I can see it is not set when a user logs in using SSO.
How is the last visit time supposed to work (if it is not updated after every action I do then my own posts would still appear as unread as they were per defenition posted after I logged in)? What can I do to fix my problem? [originally posted on jforum.net by jrouwe]
Migrated From Jforum.net
posted 6 years ago
Ok, found the bug: UserSession.updateSessionTime() is never called when you have SSO enabled.
The correct code in ControllerUtils should be:
(see comment marked with Jorrit: ...) [originally posted on jforum.net by jrouwe]