This week's book giveaways are in the Angular and TypeScript and Web Services forums.
We're giving away four copies each of Programming with Types and The Design of Web APIs and have the authors on-line!
See this thread and this one for details.
Win a copy of Programming with Types this week in the Angular and TypeScript forum
or The Design of Web APIs in the Web Services forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

Own posts appearing as unread

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm seeing the following bug:

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
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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]
 
Tick check! Okay, I guess that was just an itch. Oh wait! Just a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!