js: Sign Modal and Redirect Broken after update to 0.2.25
Broken after updating to the latest thirdweb packages as recommended to migrate to WalletConnect v2. The Sign Modal (in Metamask) does not appear, unless multiple calls to login from useLogin are made . Eventually after 3 or 4 attempts the sign modal will appear, allowing me to sign the login request and get a token. At that point the redirect back to the client does not occur.
App details
React Native 0.71.10 - React Native CLI (Non Expo)
Android 13 (Not using iOS)
Metamask Android app 7.1.0
react native third web dependencies
"@thirdweb-dev/react-native": "^0.2.25",
"@thirdweb-dev/react-native-compat": "^0.2.25",
"@thirdweb-dev/auth": "^3.2.6" on our API server
I also observe the same behaviour by while using the react native starter app. I updated the thirdweb dependencies of course.
const {login} = useLogin();
const handleLogin = async () => {
const token = await login();
console.log('logged in, token', token);
};
Here is the output when login is called:
ERROR {"context": "core"} {"context": "core/pairing"} {"context": "core/pairing/pairing"} No matching key. pairing: 303b58f2dedf452f7b440c7fb334f449b8538b9e59b9fe71c7737c7195d9a204
ERROR {"context": "client"} [Error: No matching key. pairing: 303b58f2dedf452f7b440c7fb334f449b8538b9e59b9fe71c7737c7195d9a204]
ERROR {"context": "core"} {"context": "core/pairing"} {"context": "core/pairing/pairing"} No matching key. pairing: 303b58f2dedf452f7b440c7fb334f449b8538b9e59b9fe71c7737c7195d9a204
WARN Possible Unhandled Promise Rejection (id: 0):
Error: No matching key. pairing: 303b58f2dedf452f7b440c7fb334f449b8538b9e59b9fe71c7737c7195d9a204
Error: No matching key. pairing: 303b58f2dedf452f7b440c7fb334f449b8538b9e59b9fe71c7737c7195d9a204
at getData (http://192.168.50.101:8081/index.bundle?platform=android&dev=true&minify=false&app=com.reactnativestarter&modulesOnly=false&runModule=true:111219:48)
at ?anon_0_ (http://192.168.50.101:8081/index.bundle?platform=android&dev=true&minify=false&app=com.reactnativestarter&modulesOnly=false&runModule=true:111144:44)
at next (native)
at asyncGeneratorStep (http://192.168.50.101:8081/index.bundle?platform=android&dev=true&minify=false&app=com.reactnativestarter&modulesOnly=false&runModule=true:20751:26)
at _next (http://192.168.50.101:8081/index.bundle?platform=android&dev=true&minify=false&app=com.reactnativestarter&modulesOnly=false&runModule=true:20770:29)
at anonymous (http://192.168.50.101:8081/index.bundle?platform=android&dev=true&minify=false&app=com.reactnativestarter&modulesOnly=false&runModule=true:20775:14)
at tryCallTwo (/root/react-native/ReactAndroid/hermes-engine/.cxx/Release/2q6r403w/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:61:9)
at doResolve (/root/react-native/ReactAndroid/hermes-engine/.cxx/Release/2q6r403w/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:216:25)
at Promise (/root/react-native/ReactAndroid/hermes-engine/.cxx/Release/2q6r403w/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:82:14)
at anonymous (http://192.168.50.101:8081/index.bundle?platform=android&dev=true&minify=false&app=com.reactnativestarter&modulesOnly=false&runModule=true:20767:25)
at apply (native)
at anonymous (http://192.168.50.101:8081/index.bundle?platform=android&dev=true&minify=false&app=com.reactnativestarter&modulesOnly=false&runModule=true:111148:30)
at ?anon_0_ (http://192.168.50.101:8081/index.bundle?platform=android&dev=true&minify=false&app=com.reactnativestarter&modulesOnly=false&runModule=true:111378:65)
at next (native)
at asyncGeneratorStep (http://192.168.50.101:8081/index.bundle?platform=android&dev=true&minify=false&app=com.reactnativestarter&modulesOnly=false&runModule=true:20751:26)
at _next (http://192.168.50.101:8081/index.bundle?platform=android&dev=true&minify=false&app=com.reactnativestarter&modulesOnly=false&runModule=true:20770:29)
at anonymous (http://192.168.50.101:8081/index.bundle?platform=android&dev=true&minify=false&app=com.reactnativestarter&modulesOnly=false&runModule=true:20775:14)
at tryCallTwo (/root/react-native/ReactAndroid/hermes-engine/.cxx/Release/2q6r403w/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:61:9)
at doResolve (/root/react-native/ReactAndroid/hermes-engine/.cxx/Release/2q6r403w/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:216:25)
at Promise (/root/react-native/ReactAndroid/hermes-engine/.cxx/Release/2q6r403w/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:82:14)
at anonymous (http://192.168.50.101:8081/index.bundle?platform=android&dev=true&minify=false&app=com.reactnativestarter&modulesOnly=false&runModule=true:20767:25)
at apply (native)
at anonymous (http://192.168.50.101:8081/index.bundle?platform=android&dev=true&minify=false&app=com.reactnativestarter&modulesOnly=false&runModule=true:111383:30)
at ?anon_0_ (http://192.168.50.101:8081/index.bundle?platform=android&dev=true&minify=false&app=com.reactnativestarter&modulesOnly=false&runModule=true:124686:155)
at next (native)
at asyncGeneratorStep (http://192.168.50.101:8081/index.bundle?platform=android&dev=true&minify=false&app=com.reactnativestarter&modulesOnly=false&runModule=true:20751:26)
at _next (http://192.168.50.101:8081/index.bundle?platform=android&dev=true&minify=false&app=com.reactnativestarter&modulesOnly=false&runModule=true:20770:29)
at tryCallOne (/root/react-native/ReactAndroid/hermes-engine/.cxx/Release/2q6r403w/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:53:16)
at anonymous (/root/react-native/ReactAndroid/hermes-engine/.cxx/Release/2q6r403w/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:139:27)
at apply (native)
at anonymous (http://192.168.50.101:8081/index.bundle?platform=android&dev=true&minify=false&app=com.reactnativestarter&modulesOnly=false&runModule=true:26281:26)
at _callTimer (http://192.168.50.101:8081/index.bundle?platform=android&dev=true&minify=false&app=com.reactnativestarter&modulesOnly=false&runModule=true:26200:17)
at _callReactNativeMicrotasksPass (http://192.168.50.101:8081/index.bundle?platform=android&dev=true&minify=false&app=com.reactnativestarter&modulesOnly=false&runModule=true:26230:17)
at callReactNativeMicrotasks (http://192.168.50.101:8081/index.bundle?platform=android&dev=true&minify=false&app=com.reactnativestarter&modulesOnly=false&runModule=true:26393:44)
at __callReactNativeMicrotasks (http://192.168.50.101:8081/index.bundle?platform=android&dev=true&minify=false&app=com.reactnativestarter&modulesOnly=false&runModule=true:2517:46)
at anonymous (http://192.168.50.101:8081/index.bundle?platform=android&dev=true&minify=false&app=com.reactnativestarter&modulesOnly=false&runModule=true:2329:45)
at __guard (http://192.168.50.101:8081/index.bundle?platform=android&dev=true&minify=false&app=com.reactnativestarter&modulesOnly=false&runModule=true:2501:15)
at flushedQueue (http://192.168.50.101:8081/index.bundle?platform=android&dev=true&minify=false&app=com.reactnativestarter&modulesOnly=false&runModule=true:2328:21)
at invokeCallbackAndReturnFlushedQueue (http://192.168.50.101:8081/index.bundle?platform=android&dev=true&minify=false&app=com.reactnativestarter&modulesOnly=false&runModule=true:2322:33)
After multiple attempts of going back to the app, calling login I eventually get the sign modal in metamask and a token, however the redirect to metamask also does not occur.
Also when logging out I get
[Error: missing response (requestBody="[{\"method\":\"eth_getBalance\",\"params\":[\"0xaa230911d57f49a70ec155fcec19b3b2e9716f5b\",\"latest\"],\"id\":44,\"jsonrpc\":\"2.0\"}]", requestMethod="POST", serverError={}, url="http://localhost:8545", code=SERVER_ERROR, version=web/5.7.1)]
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 15 (7 by maintainers)
@rowbot-weisguy , what happened was that since yesterday MM and all these wallets and all our Sdks are using WalletConmect V2 as the new protocol. They used to use WalletConnect V1 but it was shutdown:
https://medium.com/walletconnect/walletconnect-v1-0-sunset-notice-and-migration-schedule-8af9d3720d2e
This is the main reason why so many new issues are popping up with MM.
"@iketw I tried your approach, looks like MetaMask doesn’t open connect modal at all (in MetaMask app) with
ConnectButton, but it suggest to connect and sign when usinguseMetaMaskhook [Android tested, iOS tested]On iOS it doesn’t redirect back to the app from any wallet with any implementation (tried MetaMask, Rainbow, Trust Wallet. On Android it redirects, but not constantly
I am on
@iketw just reproduced this with
@thirdweb-dev/react-native@0.2.39Just wanted to report that this is still occurring. We have had to remove our
disabledstate on the login button so that our MetaMask users can attempt logging in as many times as required while the previous login requests variably hang.@brien-crean @T-Damer, I’m not able to 100% reproduce this but please note that there are currently some issues with WC/MM reported on their GitHub about sign dialogs not showing up:
https://github.com/MetaMask/metamask-mobile/issues/6701 https://github.com/MetaMask/metamask-mobile/issues/6655
https://github.com/WalletConnect/walletconnect-monorepo/issues/2789
As you mentioned, if this works with Trust and Rainbow that’s a good signal it’s a MM issue
thanks for the report @brien-crean, we’ll look at it ASAP