Skip to content

fix(web): don't tell owners their password is wrong when it isn't - #362

Open
Jolah1 wants to merge 1 commit into
mainfrom
fix/unlock-error-honesty
Open

Jolah1 wants to merge 1 commit into
mainfrom
fix/unlock-error-honesty

Conversation

@Jolah1

@Jolah1 Jolah1 commented Sep 11, 2026

Copy link
Copy Markdown
Owner

What's wrong

Two places that unlock the vault with the owner's password treated every non-API error as a wrong password:

  • saving a video message for the heir (VideoMessageCard.tsx)
  • sending Bitcoin from the dashboard (Dashboard.tsx, owner Send)

So a dropped connection, or a phone running out of memory while deriving the key, told the owner "That password didn't unlock the vault." An owner who believes they've lost their password may stop trusting the one thing that protects their Bitcoin, or start guessing.

AddHeirPortal.tsx already got this right with isUnsealFailure, which recognises a real decryption failure (the only thing that means a wrong password). These two never picked it up.

The fix

  • Move isUnsealFailure into a small unlockErrors.ts, alongside unlockErrorMessage(e):
    • an API error: the server's own message, as before
    • a decryption failure: "That password didn't unlock the vault. Check it and try again."
    • anything else: "Something went wrong unlocking your vault. Your password may be fine. Try again in a moment."
  • The video card and the Send flow both use unlockErrorMessage.
  • AddHeirPortal imports isUnsealFailure from the new module; its own copy is gone. Its extra "this device is locked" case is unchanged.

Tests

unlockErrors.test.ts: a decryption failure blames the password; a dropped connection and an out-of-memory error don't; an API error passes through. The existing isUnsealFailure tests now import from the new module.

tsc, eslint and vitest pass locally.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GraRi9SrkuinY5npjjkTA4

Saving a video message and sending from the dashboard reported every
non-API unlock error as a wrong password, so a dropped connection or a
phone running out of memory deriving the key told owners they had lost
a password they still had.

Move isUnsealFailure out of AddHeirPortal into unlockErrors.ts, next to
unlockErrorMessage, and use it in both places. Only a decryption
failure blames the password; anything else says the password may be
fine and to try again.

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

vercel Bot commented Sep 11, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
ghost-key Ready Ready Preview Sep 11, 2026 12:28pm UTC

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.

1 participant