Fix/account deletion cascade - #69
Merged
Merged
Conversation
…on guard (war-room #14) Audit found deletion is sound (profiles-cascade chokepoint) except events, which SET-NULLs instead of deleting. Fix: events.user_id -> ON DELETE CASCADE. Add a gated schema-completeness test (pg + SUPABASE_DB_URL, skips in CI) + one-time MCP proof + external-processor GDPR follow-up docs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Pivot regression guard from pg+DB-URL to a Postgres account_deletion_completeness() function + service-client RPC test (no new dep, MCP-verifiable). NOT EXISTS orphan scrub. Downgrade one-time proof to structural+admin.createUser. Add CSRF/SameSite note, .env*.local gitignore check, auth.audit_log_entries + Art 15/20 GDPR follow-ups, test:db checklist. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
#14) 5 tasks: MCP migration (events CASCADE + audit fn, verify empty), gated RPC test, same-origin CSRF check, docs + gitignore check, tracker to green. T1/T5 are controller-run (Supabase MCP); T2-T4 subagent-implementable. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…udit fn (war-room #14) Applied to the ai-form-coach Supabase project via MCP. Changes events.user_id FK SET NULL -> ON DELETE CASCADE, and adds account_deletion_completeness() (SECURITY DEFINER) which returns zero rows == every user table cascade-deletes. Verified empty post-apply. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…se-in-depth) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…uarded Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
War-room #14 → 🟢. Account deletion is now provably complete + guarded.
profiles.id → auth.users ON DELETE CASCADEchokepoint. The one gap —events.user_id SET NULL— is fixed toON DELETE CASCADE(migration
10_account_deletion_events_cascade.sql, applied to the live DBvia MCP; the committed SQL is idempotent).
public.account_deletion_completeness()audit function (returns offendingtables; verified empty) + a gated RPC regression test (auto-skips in CI).
POST /api/auth/delete-account.docs/technical/account-deletion.mddocuments the flow + GDPR follow-ups(auth audit log, Stripe, Sentry/Umami, backups, Art-15/20 portability).
Test Plan
account_deletion_completeness()returns 0 rows