From 67a63d9f519263d874d631c0fd4aa277ed2f4a06 Mon Sep 17 00:00:00 2001 From: piquel Date: Thu, 22 Oct 2026 13:55:17 +0200 Subject: [PATCH] feat(auth): read the deleting account status and the account purge job Account deletion (#84) writes a new account status and a new background job actor, which older releases cannot decode. This release only reads them, so the release that writes them can roll out and roll back beside it. Co-Authored-By: Claude Opus 5.5 --- crates/common/src/events.rs | 2 ++ crates/common/src/lib.rs | 3 +++ docs/architecture/database-crate.md | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/crates/common/src/events.rs b/crates/common/src/events.rs index 63ee6aca0..60cf5be4a 100644 --- a/crates/common/src/events.rs +++ b/crates/common/src/events.rs @@ -659,6 +659,8 @@ impl Actor { pub enum JobName { /// The periodic expired-state cleanup. Cleanup, + /// The purge of accounts whose deletion grace period ended. + AccountPurge, } /// A security audit log row, kept verbatim by the migrations to typed events. diff --git a/crates/common/src/lib.rs b/crates/common/src/lib.rs index ba4555fbe..863bd2160 100644 --- a/crates/common/src/lib.rs +++ b/crates/common/src/lib.rs @@ -370,6 +370,9 @@ str_enum! { Active = "active", /// The account is administratively unavailable. Disabled = "disabled", + /// The account is scheduled for deletion. It cannot sign in, but a passkey + /// can restore it until its grace period ends and it is purged. + Deleting = "deleting", } } diff --git a/docs/architecture/database-crate.md b/docs/architecture/database-crate.md index 5430ee7df..d1f28299f 100644 --- a/docs/architecture/database-crate.md +++ b/docs/architecture/database-crate.md @@ -179,6 +179,12 @@ release still reads the rows already stored. The tolerance only protects a relea that has it: ship a new variant in a later deploy than #149, so that a rollback never lands on a release without it. +Closed vocabularies stored in other columns, such as `AccountStatus` and the +`JobName` of an `Actor::System`, have no such tolerance: a release fails to decode +a value it does not know. Add the value in one release that never writes it, and +start writing it in a later one, so the release a deploy or rollback runs beside +always reads it. + ### Personal data - `domain_events` holds only non-identifying content: kind, versioned payload,