Presence servlet resets the Last Accessed Time of a Session

Description

This is a kind of tricky bug, it appears that presence sets the last accessed time for a session each time presence is displayed.

This means that presence resets the automatic logout timer and since the user is never in danger of being logged out, the automatic popup that indicated you are about to logout also does not work when you are on a site with presence enabled.

UPDATE: The tracebacks below are for the setting of the time on the ToolSession not the low-level session. As I looked through the problem with help from Stephen, the problem was not the tool session's timer but the low-level session's timer. The real problem (see comments) turned out to me a mission auto=true on the presence url.

— Below here is only interesting for historical reasons —

Here is a hand-generated traceback giving a sense of when and where this last access time is reset.

at org.sakaiproject.tool.impl.MyLittleSession.setAccessed(MyLittleSession.java:239)
at org.sakaiproject.tool.impl.MySession.getToolSession(MySession.java:492)
at org.sakaiproject.presence.impl.BasePresenceService.checkPresence(BasePresenceService.java:498)
at org.sakaiproject.presence.impl.BasePresenceService.setPresence(BasePresenceService.java:292)
at org.sakaiproject.presence.impl.BasePresenceService.setPresence(BasePresenceService.java:282)
at org.sakaiproject.presence.cover.PresenceService.setPresence(PresenceService.java:93)
at org.sakaiproject.courier.tool.CourierTool.doGet(CourierTool.java:115)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

This shows Courier accessing the tool session and resetting the accessed time.

Here is a traceback through the Presence tool:

at org.sakaiproject.tool.impl.MyLittleSession.setAccessed(MyLittleSession.java:239)
at org.sakaiproject.tool.impl.MySession.getToolSession(MySession.java:492)
at org.sakaiproject.tool.impl.ActiveToolComponent$MyActiveTool$WrappedRequest.<init>(ActiveToolComponent.java:640)
at org.sakaiproject.tool.impl.ActiveToolComponent$MyActiveTool.forward(ActiveToolComponent.java:498)
at org.sakaiproject.portal.charon.SkinnableCharonPortal.forwardTool(SkinnableCharonPortal.java:1333)
at org.sakaiproject.portal.charon.handlers.PresenceHandler.doPresence(PresenceHandler.java:140)
at org.sakaiproject.portal.charon.handlers.PresenceHandler.doGet(PresenceHandler.java:70)

Either way they ask for the Tool Session and reset the sesison's last accessed time.

The Kernel code is here:

kernel-impl/src/main/java/org/sakaiproject/tool/impl/MyLittleSession.java
kernel-impl/src/main/java/org/sakaiproject/tool/impl/MySession.java

There will need to be some sleuthing on this as to when it was introduced - or perhaps it has been there for quite a while and folks who have presence on never test the logout timer.

Help wanted
What I have not yet figured out is when this was introduced. The code in MySession dates back to r54470

Attachments

2

Activity

Stephen Marquard December 6, 2010 at 11:30 PM

2-7-x, r86008.

David Horwitz December 6, 2010 at 2:24 AM

Can't merge from trunk to 2.7:

dhorwitz@david-horwitz-4:~/branchManagement/sakai-2.7.x/portal> svn merge -c82255 https://source.sakaiproject.org/svn/portal/trunk
Conflict discovered in 'portal-render-engine-impl/pack/src/webapp/vm/defaultskin/includePageNav.vm'.
Select: (p) postpone, (df) diff-full, (e) edit,
(mc) mine-conflict, (tc) theirs-conflict,
(s) show all options:

Charles R Severance September 16, 2010 at 11:41 AM

I consider this resolved in trunk and agree with Stephen to merge or make the change by hand in 2-6-x and 2-7-x.

Charles R Severance September 16, 2010 at 11:40 AM

Yes, I agree - but it might be smarter to simply make the change in those branches by hand rather than doing a merge - either way I agree.

Stephen Marquard September 16, 2010 at 12:52 AM

Looks like the sample change of adding ?auto=true param to presence should get merged back to 2-6-x and 2-7-x.

Fixed

Priority

Affects versions

Fix versions

Components

Assignee

Reporter

Created September 13, 2010 at 5:49 PM
Updated March 27, 2012 at 7:05 AM
Resolved September 16, 2010 at 11:41 AM