Client SaaS
TypeScript
Issue Resolved
Issue #40 closed: Add comprehensive hard delete testing for cleanup command
Background
From PR #37 review - the cleanup command hard deletes users after 30 days of soft deletion.
Concern
When DeleteUserData::handle() is called with hardDelete: true on a user that was soft-deleted 30+ days ago, some related data may have already been cleaned up or have foreign key constraints that could cause issues.
Current Behavior
The DeleteUserData action handles cleanup in this order:
- Delete files from R2
- Anonymize activity logs
- Soft delete related records (profiles, certificates, etc.)
- Delete quotes, close message threads
- Finally hard/soft delete the user
Testing Needed
- Create a user with full data (profiles, jobs, quotes, messages, etc.)
- Soft delete the user
- Wait/simulate 30+ days passing
- Run
gdpr:cleanupcommand - Verify no foreign key constraint errors
- Verify all data is properly cleaned up
Priority
Low - Edge case testing, current implementation appears sound but warrants verification.
Labels
testing, gdpr