Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's wrong
Two places that unlock the vault with the owner's password treated every non-API error as a wrong password:
VideoMessageCard.tsx)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.tsxalready got this right withisUnsealFailure, which recognises a real decryption failure (the only thing that means a wrong password). These two never picked it up.The fix
isUnsealFailureinto a smallunlockErrors.ts, alongsideunlockErrorMessage(e):unlockErrorMessage.AddHeirPortalimportsisUnsealFailurefrom 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 existingisUnsealFailuretests now import from the new module.tsc,eslintandvitestpass locally.🤖 Generated with Claude Code
https://claude.ai/code/session_01GraRi9SrkuinY5npjjkTA4