Repository navigation
Fix pending submission cleanup during account deletion - #200
Open
victormeloasm wants to merge 1 commit into
Open
victormeloasm wants to merge 1 commit into
victormeloasm wants to merge 1 commit into
Conversation
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.
Deleting an account removed its crackme records from MongoDB but left the pending uploads in
tmp/crackme. Since the review queue reads that directory, these orphaned files continued to inflate the dashboard count and generate “uuid not found in db” errors. I encountered this after deleting an account responsible for flooding the submission queue.This PR removes pending uploads, published archives, and private source archives during account deletion, including attached solutions. Filesystem errors now stop the deletion instead of being silently ignored, allowing the operation to be retried. Deleting a pending solution also no longer decrements the public solution count.
For files left behind by previous deletions, I added a cleanup script that checks for missing database records and moves orphaned files into a private recovery directory. It defaults to a dry run, skips recent uploads, and does not modify database documents or published archives. Usage instructions are included in the README.
Validation: all 335 tests passed using mongomock, with 79.35% coverage. Regression tests cover a flood of 48 submissions, preservation of other users’ uploads, cascading solution cleanup, filesystem failures, and orphan-file recovery.