Make deleting an account take more than two taps - #2562
MusabShakeel576 wants to merge 1 commit into
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
| * everyone who merely opens Account details. | ||
| */ |
There was a problem hiding this comment.
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.
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
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
DELETE. Case and stray spaces don't matter, sodeletefrom an auto-capitalising keyboard works.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.components/Settings/DeleteAccountModal.tsx. Tests can't live underapp/, 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.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
components/Settings/__tests__/DeleteAccountModal.test.tsx(10 tests):DELETEis typed;isDeleteConfirmationcases.eslintandprettieron the changed files: clean.tsc --noEmit: the same 9 errors asmaster, 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
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.