give admins more warning before deleting channel
value
- we want to delete metadata associated with unused channels as frequently as possible to keep our users safe
- we also want to prevent deleting channels that people still wanted to use b/c they didn't receive or pay attention to the deletion notices we send before deleting
- this MR provides a design to extend the grace period we offer before deleting a channel and "nudge" users 3 times (instead of just 1) before actually deleting the channel
behavior
GIVEN a channel that scheduled for deletion
- WHEN 72 hours (3 days) pass from the deletion request being made
- THEN the system should delete the channel and notify admins, subscribers, and maintainers of the deletion (as it currently does)
GIVEN a channel scheduled for deletion
- WHEN {0,24,48} hours have passed from the deletion request being made
- THEN the admins of the channel receive a message that says `'Hello! This channel will be destroyed in {72,48,24} hours due to lack of use. To prevent it from being destroyed, send INFO within the next {72,48,24} hours. If you would like to destroy the channel right now, respond with DESTROY. For more info, visit https://signalboost.info/how-to.',
implementation notes
for increased deletion grace period
- edit
config.jobs.channelDestructionGracePeriod
to be 3 days (in millis)
for nudging
- add a
lastNotified
timestamp field to thedestructionRequest
model - add a
destructionRequestsRepository#getNotifiableDestructionRequests
function- this returns all destruction requests that:
-
createdAt
is more than 3 days ago -
lastNotified
is more than 1 day ago
-
- this returns all destruction requests that:
- when the
processDestructionRequests
job runs:- in addition to calling
getMatureDestructionRequests
and destroying them, also callgetNotifiableDestructionRequests
- send notifications to admins of all channels returned from this query
- in addition to calling
Edited by aguestuser