Remove the invite and sign-in log entries when an account is deleted
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- nextjs, postgresql, supabase, typescript
- Lĩnh vực
- backend, databases, documentation
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 1
- Fork
- 1
- Merge trung bình
- 6 giờ 56 phút
- Pull request đã merge (30 ngày)
- 136
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của eddiejaoude/StackDash
-
area: docs documentation priority: P3 size: S
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
eddiejaoude/StackDash#462 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: web bug priority: P3 size: XS
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 85/100
eddiejaoude/StackDash#432 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: database bug priority: P3 size: S
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
eddiejaoude/StackDash#419 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: docs bug priority: P2 size: XS
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
eddiejaoude/StackDash#418 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
accessibility area: timeline bug priority: P3 size: XS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
eddiejaoude/StackDash#389 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của eddiejaoude/StackDash
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
open-webui/tether#52 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`void platform install --app-access public` fails when Cloudflare reports Access is disabledĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
voidzero-dev/void#835 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
AykutSarac/jsoncrack.com#616 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
melgarafael/DeskcommCRM#4679 ·
Maintainer thường phản hồi trong vòng 1 ngày