-
Notifications
You must be signed in to change notification settings - Fork 321
Show last-active time on profile page #1793
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: main
Are you sure you want to change the base?
Conversation
At 4 items high, this is already a bit of a stack of information. We'll soon add a 5th item, so it'll be good to have it split up. A logical grouping is to separate the things that are potentially timely (the name adorned with presence circle and status emoji, then the status message) from the things that change rarely (the user's email and role).
Also update the TODO-comment for them to point to the issue.
Are we meant to show this for bot users? I'm not seeing this text on GitHub Bot on CZO on web, but I'm not sure if that's because it's a bot or if it just hasn't ever reported presence. |
This is probably a good prompt to implement refreshing relative times. I think that can be a follow-up, though. |
Hmm, good question about bot users. When a user hasn't ever reported presence, that doesn't cause not showing this text. Instead it produces the text "Not active in the last year"; or on web there's also the wrinkle about User.dateJoined described in this comment added in this branch: int? userLastActive(int userId) {
// The corresponding implementation on web is complicated;
// but the actual behavior seems to be this simple.
//
// In web, see buddy_data.user_last_seen_time_status; the last-active time
// is used only when the status is offline (vs active or idle).
// The timestamp comes via presence.last_active_date from the data structure
// fed by presence.status_from_raw.
//
// That status_from_raw function sometimes uses idle_timestamp;
// but only when status idle, where the timestamp will be ignored anyway.
// It also consults the equivalent of [User.dateJoined] as a fallback,
// for when processing a user who has "never logged in"... but it's
// not clear that function ever gets called in such a case.
// Those wrinkles aside, it always uses active_timestamp.
return _map[userId]?.activeTimestamp; So there's probably logic to specifically exclude bots, and we should probably do the same. Seems pretty logical product-wise. |
Thanks, and makes sense! Looks basically fine; I'll plan to take a closer look once you've added screenshots and tests. Suggestions for things you could also add, or add TODOs for (but I wouldn't block on them):
|
Fixes #1647.
Draft because I want to write some tests before merging; my manual testing hasn't reached all the different cases in this logic.