Remove the invite and sign-in log entries when an account is deleted
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- nextjs, postgresql, supabase, typescript
- Ambito
- backend, databases, documentation
Direzione di ricerca
Start at deleteUserAccount in src/lib/data/account.ts (around line 222) and read it next to removeSyntheticUser in e2e/fixtures/auth.ts, which shows the manual invite cleanup to fold in. Read the public.access_invites definition in supabase/migrations/20261031090300_jobs_and_invites.sql and copy the batching pattern from the existing purges in src/lib/jobs/retention.ts for the auth.audit_log_entries sweep, which needs a service-role SQL function since auth is not exposed to PostgREST. Done means both unit cases pass, npx supabase test db covers deleted and surviving users, and the privacy page, PRIVACY_UPDATED, docs/architecture/schema.md and scripts/invite.ts agree.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
Deleting an account leaves two records that hold the person's email address: their row on the invite list and Supabase Auth's log of sign-in events. The privacy policy from #339 (pull request #349, review round 2) now says so and tells people to email the operator to have them removed. This issue makes deletion remove them instead, so the policy can say "deleting your account removes everything".
Found by review round 2 of #349 (inline comment https://github.com/eddiejaoude/DevMacro/pull/349#discussion_r4548534055).
Evidence
deleteUserAccount(src/lib/data/account.ts:222) callsauth.admin.deleteUserand nothing else.public.access_invites(supabase/migrations/20261031090300_jobs_and_invites.sql:116) keys on the email with no foreign key toauth.users, so the row stays.scripts/invite.ts:9documents removal as a separate manual step, ande2e/fixtures/auth.ts(removeSyntheticUser) deletes the invite by hand after deleting the user.auth.audit_log_entrieskeeps every sign-up, sign-in, refresh, sign-out, and deletion event with the email inpayload.actor_username. Nothing insrc/lib/jobs/retention.ts, the migrations, orsupabase/config.tomldeletes rows from it.- Reproduced on the local stack with a synthetic user (
legal-probe-*@example.com): afterauth.admin.deleteUser,auth.sessionsheld 0 rows for the user,public.access_invitesstill held 1 row for the email, andauth.audit_log_entriesheld 7 rows naming the email (login,logout,token_refreshed,token_revoked,user_deleted,user_signedup), none with anip_address. - Hosted: Supabase writes the audit log to its own log storage always, and to
auth.audit_log_entriesonly while Authentication, Audit Logs, Write audit logs to the database is on (https://supabase.com/docs/guides/auth/audit-logs). The hosted project's setting has not been checked.
Scope
deleteUserAccountdeletes the account'saccess_invitesrow (by its lowercased email, read before the user is deleted) onceauth.admin.deleteUsersucceeds. A failure there is logged with a reference id and does not undo the deletion. A person who deletes their account then needs a new invite to come back, which matches "deleting removes everything".- The daily retention job (
src/lib/jobs/retention.ts) deletesauth.audit_log_entriesrows whosepayload->>'actor_id'no longer exists inauth.users, in batches like the other purges, through a service role database function (theauthschema is not exposed to PostgREST). - Update the privacy policy (
src/app/privacy/page.tsx: the invite item, the retention items, and the deletion paragraph),PRIVACY_UPDATED,docs/architecture/schema.md, andscripts/invite.ts's comment to match. - Not in scope: Supabase's own copy of the audit log in its log storage, which the app cannot delete; the policy keeps saying Supabase holds it for the period its service sets.
Acceptance criteria
- Deleting an account removes its invite row (unit test for the happy path and for the invite delete failing after the user is gone).
- The retention job removes audit log entries of deleted users and keeps those of existing users (database test with
npx supabase test db, both cases). - The privacy policy no longer lists the invite row or the database audit log among what survives deletion.
-
e2e/fixtures/auth.tsno longer deletes the invite by hand where the app now does it.
Model: anthropic/claude-opus-5-5 | Reasoning effort: unknown
- Lingua principale
- TypeScript
- Stelle
- 1
- Fork
- 1
- Merge medio
- 6h 56m
- PR unite (30g)
- 136
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di eddiejaoude/StackDash
-
area: docs documentation priority: P3 size: S
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
eddiejaoude/StackDash#462 ·
I maintainer di solito rispondono entro 1 giorno
-
area: web bug priority: P3 size: XS
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
eddiejaoude/StackDash#432 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area: database bug priority: P3 size: S
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
eddiejaoude/StackDash#419 ·
I maintainer di solito rispondono entro 1 giorno
-
area: docs bug priority: P2 size: XS
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
eddiejaoude/StackDash#418 ·
I maintainer di solito rispondono entro 1 giorno
-
accessibility area: timeline bug priority: P3 size: XS
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
eddiejaoude/StackDash#389 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di eddiejaoude/StackDash
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
open-webui/tether#52 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
voidzero-dev/void#835 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
AykutSarac/jsoncrack.com#616 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
melgarafael/DeskcommCRM#4679 ·
I maintainer di solito rispondono entro 1 giorno