Dormant user fix 346931
What does this MR do and why?
Before this change, recently created active users who hadn't signed in by the time DeactivateDormantUsersWorker
ran were disabled.
With this change, we limit the scope to users who have created_at
date <=
7 days ago. This ensures that DeactivateDormantUsersWorker
gives enough time for the newly-created user to sign in.
Solves: #346931 (closed)
How to set up and validate locally
In GDK enable Automatically deactivate dormant users and make sure to have two active users with no activity:
- One created more than 7 days ago
- Created less than 7 days ago
Before the change, running Users::DeactivateDormantUsersWorker.new.perform
in rails console will deactivate both users.
After the change, running the same worker will deactivate only the user who was created more than 7 days ago.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.