feat(account): delete my account in the app #63

Merged
whitlocktech merged 1 commits from feat/account-deletion into edge 2026-10-30 00:27:59 -05:00
Member

Step 4 of docs/website/ACCOUNT_DELETION.md §6 (design: §4.3). Needs core at MODULE_API 1.20.0 (website#232, merged).

What it does

  • My account gains a Delete my account row, last on the screen and under a red rule. It shows on the demo too, so Play's reviewer can find it.
  • A new screen (account/delete) shows what goes, what stays and the staff note, in the website's words. Then it asks for the typed username, the password and, when two-factor is on, an authenticator or recovery code. Delete stays off until the name matches. An account with no password gets the set-a-password note and no form.
  • MeApi.deleteAccount sends DELETE /auth/me/account and reads the raw response, so each refusal code (username_mismatch, wrong_password, code_required, wrong_code, password_required, last_admin, DEMO_LOCKED, and 429) becomes its own sentence.
  • On success, AuthRepository.forgetDeletedAccount() does what a sign-out does, without the server calls. It clears the inbox snapshot, the trust token (a sign-out keeps it, but the account is gone) and the session. Dropping the session also drops the push registration through PushManager's observer. This step can't be cancelled.
  • Afterwards the app opens sign-in, with Home beneath it, and shows "Your account has been deleted." on the shell's snackbar. The route holds the view model, so it can tell a deletion apart from any other sign-out.

Checked

  • testDebugUnitTest, lintDebug (nothing in the new code) and assembleDebug all pass locally.
  • New tests: AccountDeletionRepositoryTest, which maps each refusal and covers 429, an unknown code, no answer and the request body. AccountDeletionTest covers the confirm rule, the staff rule and each refusal's sentence.
  • Tried on the s22_ultra emulator against a local core at 7bd93b8, with two throwaway players:
    • A wrong password showed "Your password is incorrect." The server logged one 400 and no replayed call.
    • Both deletions went through, one with an authenticator code. Each opened sign-in with the notice, and back led to a signed-out Home.
  • Covered by tests only: the demo, no-password and last-admin refusals. Step 6 walks them.

Docs: RunicGateway/docs PR (step 4 recorded as built).

  • AI-assisted: written with Claude Code (Claude Opus 5.5); commits carry the Co-Authored-By trailer.

🤖 Generated with Claude Code

https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY

Step 4 of `docs/website/ACCOUNT_DELETION.md` §6 (design: §4.3). Needs core at MODULE_API 1.20.0 (website#232, merged). ## What it does - **My account** gains a *Delete my account* row, last on the screen and under a red rule. It shows on the demo too, so Play's reviewer can find it. - **A new screen** (`account/delete`) shows what goes, what stays and the staff note, in the website's words. Then it asks for the typed username, the password and, when two-factor is on, an authenticator or recovery code. *Delete* stays off until the name matches. An account with no password gets the set-a-password note and no form. - **`MeApi.deleteAccount`** sends `DELETE /auth/me/account` and reads the raw response, so each refusal `code` (`username_mismatch`, `wrong_password`, `code_required`, `wrong_code`, `password_required`, `last_admin`, `DEMO_LOCKED`, and 429) becomes its own sentence. - **On success**, `AuthRepository.forgetDeletedAccount()` does what a sign-out does, without the server calls. It clears the inbox snapshot, the trust token (a sign-out keeps it, but the account is gone) and the session. Dropping the session also drops the push registration through `PushManager`'s observer. This step can't be cancelled. - **Afterwards** the app opens sign-in, with Home beneath it, and shows "Your account has been deleted." on the shell's snackbar. The route holds the view model, so it can tell a deletion apart from any other sign-out. ## Checked - `testDebugUnitTest`, `lintDebug` (nothing in the new code) and `assembleDebug` all pass locally. - New tests: `AccountDeletionRepositoryTest`, which maps each refusal and covers 429, an unknown code, no answer and the request body. `AccountDeletionTest` covers the confirm rule, the staff rule and each refusal's sentence. - **Tried on the `s22_ultra` emulator** against a local core at `7bd93b8`, with two throwaway players: - A wrong password showed "Your password is incorrect." The server logged one 400 and no replayed call. - Both deletions went through, one with an authenticator code. Each opened sign-in with the notice, and back led to a signed-out Home. - Covered by tests only: the demo, no-password and last-admin refusals. Step 6 walks them. Docs: RunicGateway/docs PR (step 4 recorded as built). - [x] AI-assisted: written with Claude Code (Claude Opus 5.5); commits carry the `Co-Authored-By` trailer. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
wtclaude added 1 commit 2026-10-30 00:14:01 -05:00
feat(account): delete my account in the app
All checks were successful
PR Checks / android-build (pull_request) Successful in 14m55s
6be83fe70a
ACCOUNT_DELETION.md §4.3 (step 4). My account gains a Delete my account
row, last and set apart, which opens its own screen: what goes, what stays,
the staff note, then the typed username, the password and, when two-factor is
on, an authenticator or recovery code. Delete stays off until the name matches.

MeApi.deleteAccount sends DELETE /auth/me/account and reads the raw response,
so each refusal's code becomes its own sentence (the website's words). A
wrong password is a 400 (AD12), so the authenticator never replays it.

On success AuthRepository.forgetDeletedAccount does what a sign-out does
without its server calls: the inbox snapshot, the trust token (which a
sign-out keeps, but the account is gone) and the session, whose teardown
also drops the push registration. It is not cancellable. The route holds the
view model, so it tells a deletion from any other sign-out, and opens sign-in
with "Your account has been deleted." on the shell's snackbar.

Tests: the refusal mapping per code, 429, unknown codes, no answer, the
request body; the confirm rule, the staff rule, each refusal's sentence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
whitlocktech merged commit d0c5bd6ddf into edge 2026-10-30 00:27:59 -05:00
whitlocktech deleted branch feat/account-deletion 2026-10-30 00:28:00 -05:00
Sign in to join this conversation.
No description provided.