Reliably determine the last activity of an account

Description

Original report: https://github.com/mattermost/mattermost-server/issues/14620

Steps to reproduce
Likely: Set status to offline and the status table, which is used in the System Console -> Team-Stats stops updating, so the System Admin loses any way to reliably determine the last activity of an account.

Expected behavior
An existing way to determine when a user was actually last active in the System console without having to touch the DB. (-> See your warning of lost support if touched)

Observed behavior
User was displayed as last active on February 12, 2019, 06:43 AM in System Console -> Team-Stats when they were actually active in the last hour and posted at least yesterday.

Possible fixes
These come to mind:

  • Create a lastactiveat column in the accounts table and make System Console -> Team-Stats use that info. (Possibly add that info to the user-edit/info in Sysconsole)

  • Make System Console -> Team-Stats source its information from multiple tables GREATEST(MAX(sessions.lastactivityat), status.lastactivityat, users.updateat, MAX(posts.postat))

QA Test Steps

None

Mana

None

Assignee

Unassigned

QA Assignee

None

Reporter

Amy Blais

Epic Link

None

Fix versions

Mattermost Team

Platform

Sprint

None

Labels

QA Testing Areas

None

GitHub Issue

None

Components

None
Configure