Follow-up from "Cron job to delete unconfirmed users after N days"
The following discussions from !122600 (merged) should be addressed:
-
@jessieay started a discussion: (+4 comments) Note (non-blocking): these validations were added to the non-EE
ApplicationSetting
class in a previous MR but this is a Premium feature so they I am moving them as part of this MR. -
@bdenkovych started a discussion: I would suggest asserting in that test that this worker destroys active, unconfirmed users created before unconfirmed_users_delete_after_days days only.
My concern is that we could change/extend
.unconfirmed_and_created_before
scope in the future and not notice that it is being used in this worker. That could lead to unintentional data loss. -
@bdenkovych started a discussion: _confirmed_user_created_before_cut_off = create(:user, confirmed_at: Time.current, created_at: cut_off_datetime - 1.day)
for better coverage.
-
@bdenkovych started a discussion: _unconfirmed_bot_user_created_before_cut_off = create(:user, :bot, :unconfirmed, created_at: cut_off_datetime - 1.day) _deactivated_user_created_before_cut_off = create(:user, :unconfirmed, :deactivated, created_at: cut_off_datetime - 1.day)