Skip to content
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

Show user's last activity #475

Merged
merged 2 commits into from
Jul 27, 2023
Merged

Show user's last activity #475

merged 2 commits into from
Jul 27, 2023

Conversation

stnguyen90
Copy link
Contributor

@stnguyen90 stnguyen90 commented Jul 7, 2023

What does this PR do?

Show users' last activity on users list and detail pages.

Test Plan

Manual:

User Last Accessed

image image image

API Key Last Accessed

image image image

Related PRs and Issues

Depends on new Console SDK release and

Have you read the Contributing Guidelines on issues?

Yes

@stnguyen90 stnguyen90 requested a review from ArmanNik July 7, 2023 00:01
@vercel
Copy link

vercel bot commented Jul 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
console ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 26, 2023 6:26pm
console-cloud ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 26, 2023 6:26pm
console-next ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 26, 2023 6:26pm

@eldadfux
Copy link
Member

@stnguyen90 we should omit the time, the user update method happens only once a day and we record the time of the first activity of the day, starting with the 2nd activity the time is out of sync and misleading. The next update will only happen the next day.

@stnguyen90
Copy link
Contributor Author

@stnguyen90 we should omit the time, the user update method happens only once a day and we record the time of the first activity of the day, starting with the 2nd activity the time is out of sync and misleading. The next update will only happen the next day.

@eldadfux, that's a good idea to reduce confusion. FYI, we still might have some confusing data due to timezones.

@eldadfux
Copy link
Member

Why can't we take care of timezone on the console side? we should have the information on the timestamp returned from the API. Also, do we explain in the API docs that this timestamp updates once a day?

Anyway, I strongly believe we need to omit the time, the first question we'll get on Discord is why the user activity isn't updating when they see the time is stuck throughout the day.

BTW, we also have the same issue with API key, we need to fix both.

@stnguyen90
Copy link
Contributor Author

@eldadfux,

Why can't we take care of timezone on the console side? we should have the information on the timestamp returned from the API.

Let's say there's been recent activity, but the timestamp is today at 2023-07-20T02:00:00.000Z because it's still within 24 hours. Since I'm UTC-07:00, when the timestamp is localized, it becomes 2023-07-19 (yesterday).

Also, do we explain in the API docs that this timestamp updates once a day?

Here's a PR: appwrite/appwrite#5855.

@eldadfux
Copy link
Member

@eldadfux,

Why can't we take care of timezone on the console side? we should have the information on the timestamp returned from the API.

Let's say there's been recent activity, but the timestamp is today at 2023-07-20T02:00:00.000Z because it's still within 24 hours. Since I'm UTC-07:00, when the timestamp is localized, it becomes 2023-07-19 (yesterday).

Also, do we explain in the API docs that this timestamp updates once a day?

Here's a PR: appwrite/appwrite#5855.

This is fine for me, the goal here was just to show a rough range of your activity. We didn't plan for it to be accurate to the minute. We need to do the same for the API key LAST ACCESSED column.

@stnguyen90
Copy link
Contributor Author

We need to do the same for the API key LAST ACCESSED column.

@eldadfux, I updated it for API keys too.

Since accessedAt is only updated once in the last 24 hours,
showing the time can cause confusion.
@TorstenDittmann TorstenDittmann merged commit 874f7a7 into main Jul 27, 2023
@TorstenDittmann TorstenDittmann deleted the feat-last-user-activity branch July 27, 2023 12:09
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.

3 participants