Stu Mason
Stu Mason

Activity

StuMason/cleanconnect
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:

  1. Delete files from R2
  2. Anonymize activity logs
  3. Soft delete related records (profiles, certificates, etc.)
  4. Delete quotes, close message threads
  5. Finally hard/soft delete the user

Testing Needed

  1. Create a user with full data (profiles, jobs, quotes, messages, etc.)
  2. Soft delete the user
  3. Wait/simulate 30+ days passing
  4. Run gdpr:cleanup command
  5. Verify no foreign key constraint errors
  6. Verify all data is properly cleaned up

Priority

Low - Edge case testing, current implementation appears sound but warrants verification.

Labels

testing, gdpr