Skip to content

Add wallet connection stall detection and ad-blocker hint#2

Merged
sochima2 merged 1 commit into
mainfrom
codex/add-helper-to-detect-ad-blocker-interference
May 31, 2026
Merged

Add wallet connection stall detection and ad-blocker hint#2
sochima2 merged 1 commit into
mainfrom
codex/add-helper-to-detect-ad-blocker-interference

Conversation

@sochima2
Copy link
Copy Markdown
Owner

Motivation

  • Wallet extension scripts can be silently blocked by ad blockers causing useConnect/reconnect flows to hang with no error, leading to confused users and support requests.
  • Introduce a targeted detection and message to surface when a wallet attempt has stalled so users are prompted to disable ad blockers for the site.

Description

  • Add useWalletConnectionStallDetection hook in src/hooks/useWalletConnectionStallDetection.ts with a named timeout constant WALLET_CONNECTION_STALL_TIMEOUT_MS and shared message WALLET_CONNECTION_AD_BLOCKER_MESSAGE.
  • Wire the hook into ConnectWalletButton and WalletConnectCalloutBanner so the ad-blocker suggestion appears only when a wallet connection/reconnect remains pending past the timeout and is cleared when the attempt succeeds or fails.
  • Add unit tests in src/hooks/__tests__/useWalletConnectionStallDetection.test.ts covering the stalled, success-before-timeout, and failure-before-timeout behaviors.

Testing

  • Ran pnpm exec vitest run src/hooks/__tests__/useWalletConnectionStallDetection.test.ts, and the new tests passed.
  • Ran pnpm lint and pnpm build, both completed successfully.
  • A broader pnpm test invocation that ran the full suite surfaced pre-existing unrelated failures (missing test deps and unrelated assertions) which are not caused by this change.

Codex Task

@sochima2 sochima2 merged commit 7dc9326 into main May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant