Set last_login_at only on login instead of every single action #1017

Merged
tonyvince merged 1 commits from change-last_login_at-behaviour into main 2024-07-22 21:37:03 +08:00
tonyvince commented 2024-07-22 18:57:03 +08:00 (Migrated from github.com)

Currently, every request write to the users table updating last_login_at. Not sure this adds any value. This PR
limits writing users.last_login_at to POST /session and POST /registration requests only.

Screenshot 2024-07-22 at 12 45 00
Currently, every request write to the `users` table updating `last_login_at`. Not sure this adds any value. This PR limits writing `users.last_login_at` to `POST /session` and `POST /registration` requests only. <img width="1494" alt="Screenshot 2024-07-22 at 12 45 00" src="https://github.com/user-attachments/assets/5092fe0b-1ed2-4f24-a71b-6430f1b95330">
zachgoll (Migrated from github.com) approved these changes 2024-07-22 21:36:07 +08:00
zachgoll (Migrated from github.com) left a comment

I agree with this approach.

For some additional context around this—the original logic was put in a while back when we were attempting to "auto-sync" the family if the user hadn't synced for the current day. This was required to make that work, but I removed it a few weeks back as it was creating too much complexity.

I agree with this approach. For some additional context around this—the original logic was put in a while back when we were attempting to "auto-sync" the family if the user hadn't synced for the current day. This was required to make that work, but I removed it a few weeks back as it was creating too much complexity.
zachgoll (Migrated from github.com) reviewed 2024-07-22 21:36:56 +08:00
@@ -0,0 +15,4 @@
post session_url, params: { email: @user.email, password: "password" }
end
end
end
zachgoll (Migrated from github.com) commented 2024-07-22 21:36:56 +08:00

Appreciate you adding these in!

Appreciate you adding these in!
Sign in to join this conversation.