feat(server): deleting accounts and pruning abandoned ones
deletePerson deletes a person with everything they have, in one transaction and in ADR 0001 rule 6's order: their sessions first, since a device with a valid session would re-upload everything; then their memberships and personal space, whose foreign keys cascade into every synced table and the sync engine's bookkeeping; then the person, whose identities cascade. AccountEndpoint.delete deletes the caller and tells their devices that their sessions ended. pruneAbandonedAnonymousPeople deletes, 500 at a time, anonymous people created and unused for 90 days: their sessions have expired and nobody can ever return to them. Identified people are never pruned. PruningFutureCall runs it daily at 03:17; the server schedules it at start, cancelling the previous entry by its identifier first, since scheduling always adds one. Tests, refusal first: deleting when not signed in; deleting removes the caller, their sessions, their anonymous identity and the content of their space, and nobody else's; pruning takes the unused and the never-signed-in, and spares the recently used, newcomers and identified people. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
f6390120f2
commit
abe599d0aa
1 changed files with 626 additions and 0 deletions
|
|
@ -9,6 +9,7 @@ environment:
|
|||
resolution: workspace
|
||||
|
||||
dependencies:
|
||||
clock: ^1.1.3
|
||||
serverpod: 4.0.3
|
||||
serverpod_auth_idp_server: 4.0.3
|
||||
serverpod_offline_sync_server: 0.0.8
|
||||
|
|
|
|||
Loading…
Reference in a new issue