Skip to content

2914 show last login date#2936

Merged
Alkarex merged 15 commits intoFreshRSS:masterfrom
equinoxmatt:2914-show-last-login-date
May 9, 2020
Merged

2914 show last login date#2936
Alkarex merged 15 commits intoFreshRSS:masterfrom
equinoxmatt:2914-show-last-login-date

Conversation

@equinoxmatt
Copy link
Copy Markdown
Contributor

Closes #2914

Changes proposed in this pull request:

  • Upon login, user configuration file is 'touched'
  • Displays last login date on manage users and user detail screen

How to test the feature manually:

  1. Create user.
  2. Confirm 'Last Login' column on manage users screen and detail screen is 'Never Logged In'
  3. Login as new user
  4. Confirm 'Last Login' displays correct timesamp.

Pull request checklist:

  • clear commit messages
  • code manually tested
  • [] unit tests written (optional if too hard)
  • documentation updated

Additional information can be found in the documentation.

I was wondering about time formatting. I have stuck with the basic ISO 8601 format, but it isn't the most user friendly display. How are dates handled generally within the project?

Screenshot from 2020-04-30 10-33-28

Screenshot from 2020-04-30 10-33-52

@Alkarex Alkarex added this to the 1.16.1 milestone Apr 30, 2020
@equinoxmatt equinoxmatt mentioned this pull request Apr 30, 2020
3 tasks
@Alkarex
Copy link
Copy Markdown
Member

Alkarex commented May 1, 2020

Not a strong opinion, but maybe instead of login we could say a more general "last user activity"?
And we could remove never_loggedin for now.
What do others think?

@Frenzie
Copy link
Copy Markdown
Member

Frenzie commented May 1, 2020 via email

Copy link
Copy Markdown
Contributor Author

@equinoxmatt equinoxmatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a strong opinion, but maybe instead of login we could say a more general "last user activity"?
And we could remove never_loggedin for now.
What do others think?

'Last seen' maybe a good option?

@Alkarex
Copy link
Copy Markdown
Member

Alkarex commented May 2, 2020

It depends a bit on what we want to measure. In my opinion, the most interesting are user actions, which are typically not automatised.

Here are some examples (it should already now be more or less like that, but some points need to be double-checked):

Catching:

  • Explicit Web login (and only explicit)
  • Mark as read, favourite, label (from Web or API)
  • Add/remove feed/category (from Web or API)
  • Change settings
  • Add/remove user (for admins)

Not catching:

  • API synchronisation (often automatic)
  • Viewing FreshRSS RSS outputs (typically automatic)
  • Anonymous views
  • Pull-based synchronisation by cron
  • WebSub updates
  • Automatic database cleaning

@equinoxmatt
Copy link
Copy Markdown
Contributor Author

I am not sure if this is getting overcomplicated? The original issue was to fix a use case whereby an admin can quickly see which of their users are using the system. Last login is an ideal way to measure that. Even if they logged in and then straight back out, they are still using the system.

This is why my initial approach was recording the login time as opposed to when the configuration file was last modified.

I have also just discovered, when the actualize script runs, all the configuration files are touched. Therefore, you cannot rely on the configuration file modified time. Background processes modify it.

I propose we either put the last_login value back in the user config, as per my original PR or leave this issue until we have a user table.

@Alkarex
Copy link
Copy Markdown
Member

Alkarex commented May 2, 2020

My last post was only to explain the choice of the wording, not to ask for more work :-P
For instance, you might have an active user, using solely the API (e.g. from a mobile app), and never (or rarely) logging in. Therefore the login date is not a robust indication.

@equinoxmatt
Copy link
Copy Markdown
Contributor Author

My last post was only to explain the choice of the wording, not to ask for more work :-P
For instance, you might have an active user, using solely the API (e.g. from a mobile app), and never (or rarely) logging in. Therefore the login date is not a robust indication.

I see your point. How do you want to proceed with this? I don't think the file modified time can realistically be used. As I said previously, it can be modified by background processes.

@Alkarex
Copy link
Copy Markdown
Member

Alkarex commented May 2, 2020

I think we should complete this PR with the file modified time (which should still work OK even if not perfect), and wait for another PR to improve the storage of this information in a dedicated field in DB

<td><?= format_number($values['feed_count']) ?></td>
<td><?= format_number($values['article_count']) ?></td>
<td><?= format_bytes($values['database_size']) ?></td>
<td><a href="<?= _url('user', 'details', 'username', $username) ?>">Details</a></td>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line was not translated (from before this PR), so I moved the link

@Alkarex
Copy link
Copy Markdown
Member

Alkarex commented May 6, 2020

@equinoxmatt I have made a few changes. Could you please double-check whether that works for you?

@Alkarex
Copy link
Copy Markdown
Member

Alkarex commented May 9, 2020

Merging, but feedback still welcome

@Alkarex Alkarex merged commit be10486 into FreshRSS:master May 9, 2020
@equinoxmatt
Copy link
Copy Markdown
Contributor Author

@Alkarex Sorry for the delay, the changes LGTM 👍 thansk for your help on this.

@equinoxmatt equinoxmatt deleted the 2914-show-last-login-date branch May 11, 2020 09:10
@alexkuang0
Copy link
Copy Markdown

Does this last user activity field updates when users synchronize their feed using RSS clients only?

@Alkarex
Copy link
Copy Markdown
Member

Alkarex commented Aug 21, 2021

@alexkuang0 The last user activity is updated only when there is a non-automatic action such as marking an article as read, as favourite, modifying a feed / category, etc. independently of whether this is done through the Web interface or through the API.
Login in through the Web interface is also counted as an activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Show last login (use) date of a user.

4 participants