Skip to content

Make deleting an account take more than two taps - #2562

Open
MusabShakeel576 wants to merge 1 commit into
masterfrom
claude/clever-rubin-tr6ceo
Open

MusabShakeel576 wants to merge 1 commit into
masterfrom
claude/clever-rubin-tr6ceo

Conversation

@MusabShakeel576

@MusabShakeel576 MusabShakeel576 commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Why

From monday ticket 13102189944, "Accidentally Deleted Account + Missing Deposit".

On 2026-09-12 a user closed their account from Settings → Account details with two taps, "Delete account" and then "Delete Account", four seconds after opening the screen. The account held $28 in USDC. A closed account refuses every sign-in, and Amplitude shows five "This account has been closed" login failures in the next ten minutes. The account had to be reopened by hand in the database ten days later.

What

  • Typed confirmation: the Delete Account button stays disabled until the user types DELETE. Case and stray spaces don't matter, so delete from an auto-capitalising keyboard works.
  • Balance warning: when the user still holds money, the modal says so first. For example: "You still have at least $28.05 in Solid. Deleting your account doesn't move this money, and you won't be able to sign back in to reach it. Withdraw it or send it to another wallet first." Wallet (useWalletTokens) and savings (useTotalSavingsUSD) are read the same way the home screen reads them. The card is left out because its balance means different things per issuer, so the copy says "at least" rather than repeating the headline.
  • The modal moves to components/Settings/DeleteAccountModal.tsx. Tests can't live under app/, because expo-router would treat them as routes. The balance queries only run while the modal is open, and whatever was typed is cleared whenever it closes, including after a failed attempt.
  • Keyboard handling follows ResponsiveModal (KeyboardAvoidingView, padding on iOS, height on Android, off on web), so the field isn't covered on small phones.

The rest of the modal copy is unchanged. One thing to decide separately: it says deleting will "Cancel any active cards", but the backend only deletes the local card rows. This user's Rain card still attempted two charges while the account was closed. See Solid-Money/solid-backend#1852.

Related

Testing

  • New components/Settings/__tests__/DeleteAccountModal.test.tsx (10 tests):
    • the button stays disabled and does nothing until DELETE is typed;
    • any case confirms;
    • the balance warning shows for a funded account ($28.05) and not for an empty one;
    • typed text is forgotten on close;
    • plus isDeleteConfirmation cases.
  • eslint and prettier on the changed files: clean.
  • tsc --noEmit: the same 9 errors as master, all in files not touched here. None are in the changed files.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LLdGSDYoyKVTcEQ9rEEF9i


Generated by Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

A user closed their account from Settings → Account details with two
taps, "Delete account" and then "Delete Account", while it held $28 in
USDC. A closed account refuses every sign-in, so they could not get back
in to reach the money, and support had to reopen the account by hand.

The confirmation now asks for more:

- The delete button stays disabled until the user types DELETE (case
  and stray spaces don't matter). Typing a word is the one step that
  cannot happen by accident.
- When the user still holds money, the modal says how much ("You still
  have at least $28.05 in Solid"), explains that deleting doesn't move
  it and they won't be able to sign back in to reach it, and suggests
  withdrawing first. Wallet and savings are read the same way the home
  screen reads them. The card is left out because its balance means
  different things per issuer, which is why the figure is "at least".

The modal moves to components/Settings/DeleteAccountModal so it can be
tested (expo-router would treat a test under app/ as a route), and its
balance queries only run while it is open. Whatever was typed is
cleared whenever it closes, including after a failed attempt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LLdGSDYoyKVTcEQ9rEEF9i
@vercel

vercel Bot commented Sep 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated
solid-app Ignored Ignored Sep 23, 2026 1:08pm UTC
solid-app-staging Ignored Ignored Sep 23, 2026 1:08pm UTC

Request Review

Comment on lines +41 to +42
* everyone who merely opens Account details.
*/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The HeldBalanceWarning does not handle the loading state from the useTotalSavingsUSD hook, causing it to briefly not appear for users with funds only in savings.
Severity: MEDIUM

Suggested Fix

The HeldBalanceWarning component should account for the loading state of the balance queries. Either disable the delete button, show a loading skeleton for the balance, or conditionally render the warning only after the isLoading state from useTotalSavingsUSD is false. This ensures the user always sees the correct information or a loading indicator before they can act.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: components/Settings/DeleteAccountModal.tsx#L41-L42

Potential issue: The `HeldBalanceWarning` component is rendered immediately upon modal
visibility, but it does not account for the loading state of the `useTotalSavingsUSD`
hook. While the hook is fetching data, it returns `undefined`, causing the total held
balance `heldUsd` to be calculated as `0`. For a user whose funds are entirely in
savings, the warning will not be displayed initially because the calculated balance is
below the display threshold. This creates a brief window where a user with funds might
not see the warning, potentially leading them to proceed with account deletion under the
false impression that they have no funds.

Did we get this right? 👍 / 👎 to inform future reviews.

@claude

claude Bot commented Sep 23, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants