Feat: soft delete account with 30 days grace period#653
Open
patilmanasvi wants to merge 13 commits into
Open
Conversation
Contributor
|
@patilmanasvi is attempting to deploy a commit to the Shivayan's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
@Shivayan09 kindly check |
Shivayan09
requested changes
May 27, 2026
Owner
Shivayan09
left a comment
There was a problem hiding this comment.
- The server crashes in localhost, so there are errors in server
- You replaced the noraml "Logged in successfully" text with "Welcome back, account not deleted" which then shows then 2nd text even on normal login
- You pushed the changes of "save as draft" issue here as well, which mixes 2 prs. So please revert the changes of that issue
- Account deletion is fine, but it leaves behind orphaned account related data like likes, comments and more, so clean those up as well
Contributor
Author
|
Will submit changes by eod |
feat: hide deactivated accounts from search and profile lookups
Signed-off-by: patilmanasvi <manasvipatil2286@gmail.com>
be4f12b to
869dc79
Compare
…tend only Signed-off-by: patilmanasvi <manasvipatil2286@gmail.com>
…hard delete Signed-off-by: patilmanasvi <manasvipatil2286@gmail.com>
Signed-off-by: patilmanasvi <manasvipatil2286@gmail.com>
Contributor
Author
|
@Shivayan09 kindly check. the changes are done |
Owner
|
@patilmanasvi Your branch has merge conflicts, kindly pull the recent-most code from main branch and resolve the conflicts (Don't remove/overwrite any existing functionality as well) |
Shivayan09
requested changes
May 30, 2026
Owner
Shivayan09
left a comment
There was a problem hiding this comment.
Feature is close, but a few fixes are still needed before this is safe to merge:
- Enforce isDeactivated in authMiddleware so deactivated users cannot keep using protected endpoints.
- Finish the hard-delete job: delete Comment docs, remove follows/bookmarks/likes tied to the user, and clean up schema-accurate relations only.
- Add a server-side cutoff for reactivation so accounts can only be restored within the 30-day grace period, not indefinitely.
- Add tests for deactivation, reactivation, and the scheduled deletion path.
A couple of changes look out of scope / unnecessary for this feature:
- getUserProfile now selects followers and followRequests, but those fields aren’t part of the User schema.
- If possible, keep the PR focused on account lifecycle changes only and avoid unrelated cleanup unless it’s required for the flow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
Closes #607
Overview
This PR adds an Instagram-style account deletion system where accounts are first deactivated for 30 days before being permanently deleted.
Users can restore their account anytime during the grace period simply by logging back in.
Type of Change
Changes Made
Backend
Frontend
Testing
Checklist
Screen.Recording.2026-05-28.at.2.52.49.AM.mov