Skip to content

setup: in debug mode, put the request on the relay but do not open the wallet - #40

Merged
ehsan6sha merged 1 commit into
mainfrom
wallet/debug-no-auto-hop
Sep 5, 2026
Merged

setup: in debug mode, put the request on the relay but do not open the wallet#40
ehsan6sha merged 1 commit into
mainfrom
wallet/debug-no-auto-hop

Conversation

@ehsan6sha

Copy link
Copy Markdown
Member

A diagnostic, not a feature. Default behaviour is unchanged.

Why

Two logs from the reporter's phone (#38's banner) say the same thing about the splash-screen hang: every "retry" tested so far — the request link from a real tap, the bare scheme — went into a MetaMask that the first hop had already wedged on its splash screen. None of them tested whether the deep link itself is what wedges a healthy warm wallet.

Meanwhile the one recovery the logs show actually working is a cold MetaMask picking the request up with no deep link at all: the 25 s window in the first log contains no return to the page and no second hop, and the signature arrived 1.5 s after the tab came back.

So the one untested question is: does a healthy warm MetaMask show the prompt when resumed without a deep link?

What changes

With debug mode on, the sign tap publishes the request and stops there. The request is on the relay, Open wallet to approve is on screen, and a line under it says the wallet was deliberately not opened. The user switches to the wallet from recent apps and reports what it shows. The button still fires the deep link afterwards, so the same run also tests the deep link against a wallet that has not already been wedged.

The second log also confirms #39: the connect return went from 8.6 s to 0.84 s (parked the socket … 59mstransport open in 326msconnected=true +844ms).

Testing

npm test --workspaces clean. New: debug mode → request published, no assign, the note is shown, the button still hops, a late signature still lands.

🤖 Generated with Claude Code

https://claude.ai/code/session_013BpqXrkEPA9odTyRdK5Mnx

…e wallet

A diagnostic, not a feature.

Two logs from the reporter's phone now say the same thing about the
splash-screen hang. Every "retry" tested so far -- the request link from a real
tap, the bare scheme -- went into a MetaMask that the FIRST hop had already
wedged on its splash screen, so none of them tested whether the deep link itself
is what wedges a healthy warm wallet. Meanwhile the one recovery the logs show
working is a cold MetaMask picking the request up with no deep link at all: the
25 s window in the first log has no return to the page and no second hop in it,
and the signature arrived 1.5 s after the tab came back.

So the untested question is the only one left: does a healthy warm MetaMask show
the prompt when it is resumed WITHOUT a deep link? With debug mode on, the sign
tap now publishes the request and stops there -- the request is on the relay,
the "Open wallet to approve" button is on screen, and a line under it says so --
and the user can switch to the wallet from recent apps and report what it shows.
The button still fires the deep link afterwards, so the same run also tests the
deep link against a wallet that has NOT already been wedged.

Debug mode is an explicit opt-in used for exactly this kind of report; the
default path is unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013BpqXrkEPA9odTyRdK5Mnx
@ehsan6sha
ehsan6sha merged commit 4b4c936 into main Sep 5, 2026
2 checks passed
@ehsan6sha
ehsan6sha deleted the wallet/debug-no-auto-hop branch September 5, 2026 16:05
ehsan6sha added a commit that referenced this pull request Sep 5, 2026
…back to (#41)

The third diagnostic log from the reporter's phone, run with #40's "do not open
the wallet" debug mode:

    16:21:54  [tab] visible -> connected=true (+609ms)   MetaMask approved the pairing, sent the user back
    16:21:56  [sign] request on the relay ... NOT opening the wallet
    16:22:06  [tab] hidden                               user switched to MetaMask by hand -- no deep link
    16:22:14  [tab] visible -- "it was hung on splash screen"

MetaMask was already wedged BEFORE any deep link was sent to it. Twelve seconds
after it approved the pairing and returned the user to the browser, it sat on
its splash screen for a plain resume from recent apps. So the deep link was
never the trigger, and every theory built on it -- URL shape, gesture, warm
resume by intent -- is closed. Whatever puts the wallet in that state happens
on the way it returns the user; the one thing here that makes it return the
user at all is `providerMetadata.redirect` (chains.ts, added in #8 -- before
that, MetaMask left the user in the wallet).

So with debug mode on, `initAppKit` omits the redirect from the metadata it
hands to the wallet. The wallet leaves the user where they are after approving,
they switch back to the browser by hand, and when they switch to the wallet
again for the signature the log says whether it is still healthy. Decided
inside `initAppKit` because there are two call sites (LinkPassword's loader and
WalletGate) and the first to run wins; AppKit reads the metadata once, so a
change of debug mode needs a page reload. Default behaviour is unchanged.


Claude-Session: https://claude.ai/code/session_013BpqXrkEPA9odTyRdK5Mnx

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
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