feat(user): run GDPR deletion as a durable admin queue - #5303
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Previous Review Summaries (7 snapshots, latest commit c33e7b4)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit c33e7b4)Status: 1 Issue Found | Recommendation: Address before merge Executive SummarySelf-service Overview
Issue Details (click to expand)CRITICAL
Files Reviewed (7 files)
Fix these issues in Kilo Cloud Previous review (commit 872f5f7)Status: 1 Issue Found | Recommendation: Address before merge Executive SummaryIncrement Overview
Issue Details (click to expand)CRITICAL
Files Reviewed (6 files)
Fix these issues in Kilo Cloud Previous review (commit 4e1c777)Status: 1 Issue Found | Recommendation: Address before merge Executive SummaryIncrement Overview
Issue Details (click to expand)CRITICAL
Files Reviewed (58 files)
Fix these issues in Kilo Cloud Previous review (commit 923a1f4)Status: 3 Issues Found | Recommendation: Address before merge Executive SummaryIncrement Overview
Issue Details (click to expand)CRITICAL
WARNING
SUGGESTION
Resolved since last review (verified at HEAD)
Files Reviewed This Increment (45 files)
Fix these issues in Kilo Cloud Previous review (commit 4bbbc19)Status: 4 Issues Found | Recommendation: Address before merge Executive SummaryIncrement Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed This Increment (7 files)
Fix these issues in Kilo Cloud Previous review (commit 17fa544)Status: 4 Issues Found | Recommendation: Address before merge Executive SummaryIncrement Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed This Increment (6 files)
Fix these issues in Kilo Cloud Previous review (commit 50937bd)Status: 4 Issues Found | Recommendation: Address before merge Executive SummaryIncrement Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed This Increment (8 files)
Reviewed by grok-4.6 · Input: 110.3K · Output: 9.1K · Cached: 398.7K Review guidance: REVIEW.md from base branch |
17fa544 to
4bbbc19
Compare
pandemicsyn
left a comment
There was a problem hiding this comment.
two findings from my local robot inline. Both sound very edge cases (especially the pause race) , so feel free to ignore.
4bbbc19 to
923a1f4
Compare
Disable matching Cloud accounts immediately, persist a deletion-task catalog in PostgreSQL, and anonymize only after cron retries succeed. Treat deletion-in-progress as gone for owner matching, and keep HMAC/encrypted audit subjects from re-enqueuing already-covered resources. Scrub usage prompt prefixes as a paginated deletion-queue step so large usage histories cannot timeout Cloud user deletion.
872f5f7 to
e377faa
Compare
Main's requestAccountDeletion still imported the removed GDPR helper, which broke tRPC typecheck and setup-smoke. Re-export the subscription preflight used by deletion preview, and queue self-service deletion instead of the old synchronous wipe.
protected_self is an intake rule. Re-running it in preflight parked email-confirmed self-deletes as attention and left the account live.
pandemicsyn
left a comment
There was a problem hiding this comment.
one inline, seems very edge case though. If a user logs in via work os after having requested deletion at the exact time the deletion happens ? I'm not sure its worth the effort.
| const existingUser = await findUserById(existingKiloUserId); | ||
| if (!existingUser) return failureResult('USER-NOT-FOUND'); | ||
|
|
||
| if ( |
There was a problem hiding this comment.
bot: This fence protects the normal linking path, but createOrUpdateUser has a separate same-email WorkOS branch that deletes/reinserts user_auth_provider and rotates web_session_pepper without calling linkAccountToExistingUser or authPassesDeletionFence. An active deletion request can therefore still have its auth identity mutated through a WorkOS login. Please apply the same fence in that transaction (or route WorkOS through this helper) and add an active-deletion + WorkOS auto-link regression test.
Summary
Replace one-shot Cloud GDPR deletion with a durable admin deletion queue.
/admin/deletion-queuefor intake, retry, and mark-done.PostHog, Substack, and Pylon remain CSA-handled for this first cut. Add-requests is hidden in the queue UI; start deletion from the user profile or CSA API.
Test plan
/admin/deletion-queue.process-user-deletionsuntil teardown succeeds and anonymize runs only after required tasks complete.Local E2E on
http://localhost:6200/(offset 3200):/admin/deletion-queue. Start deletion from user Admin Tools (handbook checkbox → confirm → queued).<div>inside<p>. Cancel/retry now invalidate the queue summary.cli_sessions_v2rows, batch 10. Invalid IDs (ses_chunk_001) returnedhttp_400because ingest requiresses_+ 26 chars. Valid IDs + admin retry → continue, continue, succeeded.Not covered locally: PostHog/Substack/Pylon (CSA).