fix(session): Update last_seen when user session is validated#50835
fix(session): Update last_seen when user session is validated#50835
last_seen when user session is validated#50835Conversation
last_seen when user session is validated
|
I've put this change as-is into production 1 year ago (since v30). Now I can see that users listed seen before, by the system, as "months ago", are in fact active, and are now listed as last seen "minutes" or "hours" ago. This is what I expect to be reported. |
come-nc
left a comment
There was a problem hiding this comment.
How often is that executed?
It turns last login into last activity, no?
I understand the issue though, for webdav each request is a login, no?
As per actual logic, it would be updated, at most, once every 60s.
Exactly, but I, as sysadmin, don't care if my user logged in 3 months ago; what's important to know is if the user is active (using/interactting the platform) or not. Column is (correctly) named |
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Summary
While doing some maintenance on my instance, I've saw a lot of users with
last_seentimestamp a few months ago, like 7 months ago or even more than a year. So, I've disabled them.A couple of minutes later, some of them were complaining their user account was disabled 😿
Example:
As you can see,
last_seenstates user was last seen (wrongly) 6 months ago.Yet, on the webserver log, we can see that this same user performed some operations only minutes ago:
Problem is that those users NEVER use the WebUI, they only use some apps to sync their data, like Calendar or Contacts sync, etc. So, they never complete a full logout + full login.
My proposal here is to update the
last_seentimestamp also when we validate their session, since that, in my opinion, as an instance administrator, I want to be able to rely on thelast_seenfield to really know when the user was last seen (and by last seen, I mean user has done some kind of legit activity on the instance, while being a valid user). As per actual logic, it would be updated, at most, once every 60s.IMO, this is actually a bug (not a feature) because updating
last_seenfield only on full logout + login is not reliable.Please review.
Checklist