Skip to content

feat: improve last login data #5745

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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Conversation

Zaimwa9
Copy link
Contributor

@Zaimwa9 Zaimwa9 commented Jul 10, 2025

Thanks for submitting a PR! Please check the boxes below:

  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

Solves #2183

last_login was natively updated by DRF only during authentication. However we persist session for multiple weeks leading to incorrect data.

This PR aims to update last-login on GET /me (once per session in a ideal world) with a 10min buffer. This could be multiple hours as we only show Today in the dashboard.

Additionally:

  • Refactored LastLogin component in the frontend
    We used to show Never | within 30 days | with {xx} days if > 30 => Allowed to add Today Yesterday and number of days within 30 days (7 days ago e.g).
  • Refactored Members Table in the frontend

How did you test this code?

  • Added tests
  • On the dashboard

@Zaimwa9 Zaimwa9 requested review from a team as code owners July 10, 2025 15:00
@Zaimwa9 Zaimwa9 requested review from kyle-ssg and emyller and removed request for a team July 10, 2025 15:00
Copy link

vercel bot commented Jul 10, 2025

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

Name Status Preview Comments Updated (UTC)
flagsmith-frontend-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 15, 2025 6:26am
flagsmith-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 15, 2025 6:26am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Jul 15, 2025 6:26am

@Zaimwa9 Zaimwa9 marked this pull request as draft July 10, 2025 15:00
@github-actions github-actions bot added front-end Issue related to the React Front End Dashboard api Issue related to the REST API feature New feature or request labels Jul 10, 2025
Copy link
Contributor

github-actions bot commented Jul 10, 2025

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-5745 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-5745 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-5745 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-5745 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-5745 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-frontend:pr-5745 Finished ✅ Results

@Zaimwa9 Zaimwa9 requested review from khvn26 and removed request for emyller July 10, 2025 15:18
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jul 10, 2025
@Zaimwa9 Zaimwa9 marked this pull request as ready for review July 10, 2025 15:26
@github-actions github-actions bot removed the feature New feature or request label Jul 10, 2025
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jul 10, 2025
Copy link

codecov bot commented Jul 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.77%. Comparing base (58bdf04) to head (1aa655f).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5745   +/-   ##
=======================================
  Coverage   97.77%   97.77%           
=======================================
  Files        1255     1255           
  Lines       44357    44386   +29     
=======================================
+ Hits        43371    43400   +29     
  Misses        986      986           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@khvn26 khvn26 left a comment

Choose a reason for hiding this comment

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

One minor comment, otherwise LGTM.

Copy link
Member

@khvn26 khvn26 left a comment

Choose a reason for hiding this comment

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

Actually, having read the backend test, I have one request now.

@Zaimwa9 Zaimwa9 requested a review from khvn26 July 11, 2025 09:53
@Zaimwa9 Zaimwa9 requested a review from khvn26 July 14, 2025 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API feature New feature or request front-end Issue related to the React Front End Dashboard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants