mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-09-26 04:04:15 +00:00
clean up logs, delete cached data when atproto account is deleted
This commit is contained in:
@@ -691,4 +691,27 @@ func TestProcessAccount(t *testing.T) {
|
||||
if !exists {
|
||||
t.Error("User should still exist after multiple deactivation events")
|
||||
}
|
||||
|
||||
// Test 6: Process account deletion - should delete user data
|
||||
err = processor.ProcessAccount(context.Background(), testDID, false, "deleted")
|
||||
if err != nil {
|
||||
t.Logf("Cache invalidation error during deletion (expected): %v", err)
|
||||
}
|
||||
|
||||
// User should be deleted after "deleted" status
|
||||
err = db.QueryRow(`
|
||||
SELECT EXISTS(SELECT 1 FROM users WHERE did = ?)
|
||||
`, testDID).Scan(&exists)
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to check if user exists after deletion: %v", err)
|
||||
}
|
||||
if exists {
|
||||
t.Error("User should NOT exist after deletion event")
|
||||
}
|
||||
|
||||
// Test 7: Process deletion for already-deleted user (idempotent)
|
||||
err = processor.ProcessAccount(context.Background(), testDID, false, "deleted")
|
||||
if err != nil {
|
||||
t.Errorf("Deletion of non-existent user should not error, got: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user