Repository navigation
fix(web): wallet renewal of a browser's own key doesn't claim a wallet gave it - #689
Conversation
…t gave it Found in the live testnet renewal of a key the browser registered itself (#667's skipped case): the request said "Approve the renewal in the wallet that gave this browser its key". Only an App Connect key gets that line. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 28 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
PastaPastaPasta
left a comment
There was a problem hiding this comment.
Verdict: approve
I checked head 6363315 against each key origin. This was a code read; I did not run anything locally.
What origin holds (KeyOrigin = 'dg' | 'app-connect' | 'passkey', forge-web/lib/auth/vault.ts:165. useAuth().origin = session?.origin ?? null):
- A wallet grant gets
'app-connect'(wallet-connect-flow.tsx:306, thenadoptWalletKeys). The old line stays for this key only, and it is still true. - A passkey restore gets
'passkey'(controller.ts:2422). This is true even when the restored key began as an App Connect grant: the restore replaces the origin, andwalletLeavesLivethen treats it as not the wallet's own grant. "Approve in the wallet that holds this identity" makes no claim about where the key came from, so it holds here. It also agrees with the prepare step's passkey copy (":545", "If a wallet made it…"). - A
dghandoff gets'dg'(controller.ts:1200). It reaches the wallet renewal only on testnet (renewsInWallet). The new copy is true. - A key registered here from the recovery phrase or identity file is stored with no origin (
controller.ts:1092/974), so it isnull. This is the case the PR fixes, and the new copy is true. - A pasted raw key is
storage: 'session'.startWalletRenewalrefuses anything that isn'tvault(controller.ts:1417), so the renew flow never shows it this line.
Other renew copy: the prepare step (:542-546) and the renew-store step (:627) already split on origin. Their non-App-Connect wording ("Your wallet didn't make this browser's key", "Your wallet gave this browser a new key") is true. Outside this flow, top-up-sheet.tsx:116 and key-revoke-dialog.tsx:89 (walletFirst requires origin === 'app-connect') use "gave this browser its key" only for app-connect. I found no other false claim.
CHANGELOG: it is accurate for the case it describes. Nit, not blocking: dg and passkey-restored keys get the new line too, so "a key no wallet granted to this browser" would describe the change more fully.
Test: the mock now carries origin and defaults to 'app-connect', so the existing renew tests keep the App Connect wording. The new test covers null. Not blocking: the 'passkey' and 'dg' branches have no test of their own.
CI was still pending when I checked (CodeRabbit only rate-limited). That doesn't change the verdict for a copy-only change.
🤖 Posted autonomously by Claude (claude-opus-5-5) on behalf of pasta.
…ser-key # Conflicts: # CHANGELOG.md
Problem
#667 skipped one live case: renewing in DashPay a key that the browser registered itself (from the recovery phrase), rather than one a wallet granted. I ran that case on testnet tonight. It works, but the request said:
No wallet gave this browser that key: the browser registered it with the recovery phrase.
Fix
Only an App Connect key (
origin === 'app-connect') gets that line. Any other key now reads "Approve in the wallet that holds this identity." A test covers a browser-registered key, and the test mock now carriesorigin.The live run (testnet, DashPay Wallet 11.9.2 testnet APK on an Android 36 emulator)
Wallet-side observations, noted only (no new wallet work):
PREORDER_REGISTERING. Approving the connection still worked. (screen)Checks: typecheck, eslint, copy lint and
wallet-connect-flow.test.tsx(27/27) pass, run in a boat.dev sandbox.🤖 Generated with Claude Code