You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, we have the postDeletionTimeline field for all Users, which is meant to specify how long a post should remain on the FOCUS site before it is to be automatically deleted.
This is what postDeletionTimeline looks like in the User schema:
And in the frontend User Settings & Preferences page:
Goal
We want to implement the functionality for postDeletionTimeline. Depending on what duration the user selects, we want to implement a MongoDB property for all Post documents to have a time to live, or TTL, Index. Then, MongoDB will automatically deal with posts that reach the end of their life by deleting them from the database.
If a user changes their postDeletionTimeline from a longer duration to a shorter duration (Like 4 years -> 1 month), we need to delete any existing posts that exceed this duration. If a user chooses an option that is less than the current option, provide a popup that warns the user that "Any posts that you have posted over [duration] ago will be deleted forever"
If they agree and you need to delete posts, go through all the posts that a user owns and delete it if currentTime - Post.date > postDeletionTimeline. Basically if any post is older than the newly selected postDeletionTimeline, delete it.
Acceptance Criteria
A post will expire [duration] seconds after it has been posted
postDeletionTimeline functionality works for (4 years / 2 years / 1 year / 6 months / 3 months / 1 month).
Turn these durations into seconds to be inputted into the expireAfterSeconds field in MongoDB.
If a user updates their postDeletionTimeline to be shorter than the current postDeletionTimeline, provide a warning
Posts can be deleted retroactively by iterating through a user's posts and calculating post age.
The text was updated successfully, but these errors were encountered:
Description
At the moment, we have the
postDeletionTimeline
field for all Users, which is meant to specify how long a post should remain on the FOCUS site before it is to be automatically deleted.This is what
postDeletionTimeline
looks like in the User schema:And in the frontend User Settings & Preferences page:
Goal
We want to implement the functionality for
postDeletionTimeline
. Depending on what duration the user selects, we want to implement a MongoDB property for all Post documents to have a time to live, or TTL, Index. Then, MongoDB will automatically deal with posts that reach the end of their life by deleting them from the database.TTL Index
TTL Index Documentation
Retroactive expiration
If a user changes their
postDeletionTimeline
from a longer duration to a shorter duration (Like 4 years -> 1 month), we need to delete any existing posts that exceed this duration. If a user chooses an option that is less than the current option, provide a popup that warns the user that "Any posts that you have posted over [duration] ago will be deleted forever"If they agree and you need to delete posts, go through all the posts that a user owns and delete it if
currentTime - Post.date > postDeletionTimeline
. Basically if any post is older than the newly selectedpostDeletionTimeline
, delete it.Acceptance Criteria
postDeletionTimeline
functionality works for (4 years / 2 years / 1 year / 6 months / 3 months / 1 month).postDeletionTimeline
to be shorter than the currentpostDeletionTimeline
, provide a warningThe text was updated successfully, but these errors were encountered: