Skip to content

Fix pending submission cleanup during account deletion - #200

Open
victormeloasm wants to merge 1 commit into
crackmesone:mainfrom
victormeloasm:fix/pending-submission-cleanup
Open

victormeloasm wants to merge 1 commit into
crackmesone:mainfrom
victormeloasm:fix/pending-submission-cleanup

Conversation

@victormeloasm

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant