Skip to content

Skip reconnecting MetaMask when another wallet provides window.ethereum - #802

Merged
apbendi merged 1 commit into
masterfrom
skip-metamask-unlock-check-without-metamask
Nov 17, 2026
Merged

apbendi merged 1 commit into
masterfrom
skip-metamask-unlock-check-without-metamask

Conversation

@apbendi

@apbendi apbendi commented Nov 17, 2026

Copy link
Copy Markdown
Member

When MetaMask was the last wallet used, the app checks whether it's unlocked before reconnecting, through window.ethereum._metamask. Another wallet, or none, can provide window.ethereum instead, and then the check threw and the user saw an error.

A missing _metamask now counts as not unlocked, so the app leaves the wallet disconnected without an error, as it does when MetaMask is locked. Nothing changes when MetaMask provides window.ethereum.

When MetaMask was the last wallet used, the app checks whether it's
unlocked before reconnecting, through window.ethereum._metamask. Another
wallet, or none, can provide window.ethereum instead, and then the check
threw and the user saw an error.

A missing _metamask now counts as not unlocked, so the app leaves the
wallet disconnected without an error, as it does when MetaMask is
locked. Nothing changes when MetaMask provides window.ethereum.
@apbendi
apbendi requested a review from mikeghen November 17, 2026 18:40
@netlify

netlify Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for jolly-shaw-20fe62 ready!

Name Link
🔨 Latest commit 8b2d785
🔍 Latest deploy log https://app.netlify.com/projects/jolly-shaw-20fe62/deploys/6afc9f95976556314551232c
😎 Deploy Preview https://deploy-preview-802--jolly-shaw-20fe62.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

Copy link
Copy Markdown

Coverage after merging skip-metamask-unlock-check-without-metamask into master will be

88.10%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
contracts-periphery/src
   UmbraBatchSend.sol100%100%100%100%
   UniswapWithdrawHook.sol100%100%100%100%
umbra-js/src
   ethers.ts82.22%100%63.64%100%
umbra-js/src/classes
   KeyPair.ts98.54%97.62%100%98.75%248, 250
   RandomNumber.ts100%100%100%100%
   StealthKeyRegistry.ts100%100%100%100%
   TxHistoryProvider.ts81.48%65%80%93.10%12, 17, 20, 23, 29, 43, 48, 54, 8
   Umbra.ts82.65%72.22%93.02%87.59%167–168, 189, 262–263, 331, 349–352, 388–389, 413, 428, 431, 438–440, 442, 449, 452, 452, 452–453, 460, 460, 460, 460, 460–461, 463–464, 494, 494, 494, 496, 496, 496, 498, 498, 498, 498–499, 499, 499–501, 517–518, 583–585, 62, 62, 626, 681, 685, 731, 744–745, 755–756, 770, 778–779, 809–810, 885–886, 889, 892–893, 899–901, 908, 908, 908–911, 946, 948–949, 949–950
umbra-js/src/utils
   constants.ts100%100%100%100%
   sharedSecret.ts83.05%72.73%100%87.88%24, 27–28, 42–43, 47–48, 62, 62–63
   utils.ts77.72%71.25%87.50%81.65%109–110, 1173–1174, 1186–1187, 135, 143, 143, 159–161, 163–165, 171, 193–194, 220–222, 222, 222–223, 223, 223, 304, 307, 312, 316, 320, 330, 342–347, 349–356, 356, 356, 356, 356, 356, 356–357, 359, 369, 400–402, 408, 418–419, 426–427, 434, 444, 444–445, 445–446, 451, 481–482, 491–492, 512–514, 527–528, 554–556, 565, 638, 645, 645–646, 646, 646–647, 647, 649, 653, 716, 718–719, 727–728, 746, 777, 799–801, 804, 814, 826, 826–827, 832, 834–835, 846–850, 863, 865, 916–917, 917, 917–919, 919, 919, 930
umbra-js/test
   testPrivateKeys.ts100%100%100%100%
   utils.ts100%100%100%100%

@apbendi
apbendi merged commit 53ed4af into master Nov 17, 2026
8 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.

2 participants