Repository navigation
feat(moderation): handle user.delete by deleting the local account (A5) - #135
Open
sloanfinger wants to merge 1 commit into
Open
sloanfinger wants to merge 1 commit into
sloanfinger wants to merge 1 commit into
Conversation
sloanfinger
requested review from
a team,
skarthikb-tech and
smcodes612
as code owners
October 23, 2026 21:20
Contributor
Author
|
Reviewed user.delete parsing, moderation recording, retry handling, and local account deletion against No additional confirmed correctness issue identified in the inspected changes. Existing CI results were inspected; the complete repository test suite was not rerun for this review. |
sloanfinger
force-pushed
the
df/a5-user-delete
branch
from
October 27, 2026 08:16
b836aa5 to
b7923f4
Compare
This branch has not been deployed
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.
What it delivers
DogPack now handles the platform's
user.deletemoderation message.moderation.apply_eventrecords the id and ordering decision, sets the user state todeleted(reason dropped, anddata.reasonnulled in the stored payload), and locks the linked account out at once (banned_until, auth sessions revoked). Theplatform-moderationfunction then finds the local user through thecustom:devdogsugaidentity and callsauth.admin.deleteUser. All DogPack tables referenceauth.userswithon delete cascade, so profile, enrollments, hosted sessions and rosters, memberships, blocks (both directions) and the onboarding marker go with the account.moderation.user_stateskeeps only the platform user id with statedeleted.Decisions implemented
user_not_foundcounts as success.docs/guides/backend.mdand the SQL comments, and covered by pgTAP.duplicate(200); an unknown platform user returnsapplied(200).staleandduplicate, because deletion is final on the platform.@devdogsuga/sdkmoderation files are untouched (check-vendored.mjsreports all three ok)._shared/user-delete.tsparsesuser.deletelocally; delete it once the vendored copy is re-vendored from a commit that includes DevDogsUGA #215.New secrets / env
None.
Product decisions for Sloan to confirm
user_statesrow stays with statedeletedand no reason, so a late or replayed message about that account is harmless. Say so if you want it purged.moderation.eventswith their reasons (Q48 does not require nulling).user_states_state_validis widened with DROP CONSTRAINT + ADD CONSTRAINT, which the destructive gate may flag. Apply theallow-destructivelabel knowingly if so.Unverified
03_moderation.test.sql, plan 59) and the Deno e2e case were not run locally (no Supabase/Docker per machine rules); CI runs them. Assertion count was verified by hand.apply_eventbody and constraint change were not applied to a database; the generated migration SQL needs review in CI.deno check --frozenon the handler (passes) anddeno teston_shared(7 passed).Screenshots
None (no UI).
Part of the DevDogs deferred-features plan, stage A5 (TASK-527). Pairs with DevDogsUGA #215 (A1, the user.delete event type) and #218 (A2, the job that sends it).
🤖 Generated with Claude Code