-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix(session): Update last_seen when user session is validated
#50835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Git'Fellow <[email protected]>
last_seen when user session is validated
|
I've put this change as-is into production 2 days ago (v30). Now I can see that users listed as seen 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
Summary
While doing some maintenance on my instance, I've saw a lot of users with last_seen timestamp 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