Skip to content

fix(web): wallet renewal of a browser's own key doesn't claim a wallet gave it - #689

Merged
PastaPastaPasta merged 2 commits into
masterfrom
fix/renew-copy-browser-key
Nov 24, 2026
Merged

PastaPastaPasta merged 2 commits into
masterfrom
fix/renew-copy-browser-key

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Owner

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:

Approve the renewal in the wallet that gave this browser its key.

No wallet gave this browser that key: the browser registered it with the recovery phrase.

request

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 carries origin.

The live run (testnet, DashPay Wallet 11.9.2 testnet APK on an Android 36 emulator)

  1. I imported identity FRxiZ1S… with its recovery phrase on a static build of master (b5917e6 plus the fix(web): bound the quorum key fetch, keep good keys, cap connect retries #681 quorum fix). The browser registered key fix: make the Testnet Nightly green and trustworthy #10 itself. (settings)
  2. Renew in your wallet. After a reload, the dialog first asks to unlock the tab, which is by design: a reload keeps only the spend-capped key. (unlock) Then it shows the request: 0.05 DASH, until Feb 22, 2027.
  3. In the wallet, restored from the same phrase: until it synced, the link showed "Connection records unavailable". (before sync) Once it synced, the same link opened Approve connection to "Dash Forge" for FRxiZ1S…, 0.05 DASH, expiring Feb 22, 2027. (approve)
  4. After I approved, Forge stored key feat: per-network configuration with named devnets and no hard-coded contract ids #11, "From: Your DashPay wallet (App Connect)", with a budget of 0.05 DASH. It says honestly that "key fix: make the Testnet Nightly green and trustworthy #10, left live by an earlier renewal" stays live until a renewal with the identity file or Revoke on Platform disables it. That is the design feat(web): on testnet, renew in the wallet first; revoke a wallet key by disconnecting it #667 chose for keys the wallet didn't grant. (after) Key feat: per-network configuration with named devnets and no hard-coded contract ids #11 was still in use after a reload.

Wallet-side observations, noted only (no new wallet work):

  • After restoring an identity created by Forge (one with no username), DashPay shows "Error Upgrading" in its history. Its log has the identity in PREORDER_REGISTERING. Approving the connection still worked. (screen)
  • A link opened before the wallet's records load is dropped. It must be opened again after sync. Forge's docs already say a freshly restored wallet may not answer until it has synced.
  • The wallet presents a renewal of a browser-registered key as a first-time "connection" ("You have never connected to this DAPP before"). That's expected, since this wallet never granted a key to Forge.

Checks: typecheck, eslint, copy lint and wallet-connect-flow.test.tsx (27/27) pass, run in a boat.dev sandbox.

🤖 Generated with Claude Code

…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]>
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b4ddd198-d3aa-498c-96ee-2640d041b9de
Commits

Reviewing files that changed from the base of the PR and between 4e2e476 and ac89776.

Files selected for processing: 3

  • CHANGELOG.md
  • forge-web/components/auth/wallet-connect-flow.test.tsx
  • forge-web/components/auth/wallet-connect-flow.tsx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@PastaPastaPasta PastaPastaPasta left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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, then adoptWalletKeys). 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, and walletLeavesLive then 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 dg handoff 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 is null. This is the case the PR fixes, and the new copy is true.
  • A pasted raw key is storage: 'session'. startWalletRenewal refuses anything that isn't vault (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.

@PastaPastaPasta
PastaPastaPasta merged commit 6ae4a7f into master Nov 24, 2026
21 of 39 checks passed
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