pair() doesn't work for valid URIs in React Native / Android #5161
Replies: 18 comments
-
CR-15 pair() doesn't work for valid URIs in React Native / Android |
Beta Was this translation helpful? Give feedback.
-
Hey @preetish-brine, could you double check that you're passing valid/unused pairing URI please. The |
Beta Was this translation helpful? Give feedback.
-
Additionally, please make sure that you're subscribed to receive |
Beta Was this translation helpful? Give feedback.
-
I have tried to clear caches and generate new URI schemes as well , doesnt seem to work, I am already aware of the cache issue and was facing the same while integrating deep link to sign client, used to make it run by doing clear cache and generating new URI schemes |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
It seems that both useEffects
are run at the same time by |
Beta Was this translation helpful? Give feedback.
-
I actually tested the sign client SDK in the similar pattern and it was working in that case, i think race condition is not the actual issue, Also i moved the pair to a callback initiated by a user button click and the behavior is same. my closest assumption of the reason of this issue is the relayer / event emitter is somehow not emitting the event |
Beta Was this translation helpful? Give feedback.
-
@preetish-brine could you provide a minimal reproducible example of the issue please? |
Beta Was this translation helpful? Give feedback.
-
I tried investigating it all a bit and found out that your own examples serve as the best repoducible example of this issue. Try running these two:
The first one works (it uses version |
Beta Was this translation helpful? Give feedback.
-
Hey @alwx 👋 I'll need your help to reproduce the issue, as it works well on my android device using the Screenrecorder.May.29.2024.mp4Does it always happen? Or just in cold boots of the app? |
Beta Was this translation helpful? Give feedback.
-
Maybe this helps: a while ago we had an issue related with events and it turned out that there was a conflict with different versions of the Can you check if installing just one version fixes the issue? You can do it by adding this to your
The older version is being installed by |
Beta Was this translation helpful? Give feedback.
-
@ignaciosantise I'm trying it on emulator (AVD), maybe using a physical device makes a difference? I will check it today on a physical device and with the solution you're proposing, and then will come back to you. |
Beta Was this translation helpful? Give feedback.
-
Interesting but running the example (
Adding |
Beta Was this translation helpful? Give feedback.
-
Hey @alwx 👋 it should work on emulators too. Some questions:
|
Beta Was this translation helpful? Give feedback.
-
@ignaciosantise But did the testing again right now, and here is the video. Github doesn't allow to attach videos more than 10 MB in size, so here is the link to it: https://files.alwxdev.com/rn_cli_wallet_video.mov I am not using any VPN. This is |
Beta Was this translation helpful? Give feedback.
-
@ignaciosantise we temporarily fixed our issue by downgrading |
Beta Was this translation helpful? Give feedback.
-
Hey @alwx sorry for the delay. Seeing your video, it seems there's something wrong with that pairing uri. How are you generating it? Can you try getting the uri from here ? This are the specs for the Pairing URIs -> https://specs.walletconnect.com/2.0/specs/clients/core/pairing/pairing-uri edit: okey, the URI in the command line is OK, but the one being pasted in the input is incomplete. right? It only contains |
Beta Was this translation helpful? Give feedback.
-
I copied the URI from your command line and i get the Can you check what happens if you go to https://react-app.walletconnect.com/ from the emulator? and copying the uri from there |
Beta Was this translation helpful? Give feedback.
-
Discussed in https://github.com/orgs/WalletConnect/discussions/4467
Originally posted by preetish-brine April 22, 2024
Hey guys, I worked on Migration of the SDK from sign-client "^2.2.1" to @walletconnect/web3wallet "^1.11.2", and I have been facing issues while triggering the pair function to pair to a Dapp URI to my wallet app, I have tried logging the web3wallet client and the pair function instances, nothing seems wrong in that and i am able to log the client instance.
However, the pair function goes into a loop for valid cases, If its a invalid URI, it is returning a Error as Invalid URI but for the else case it gets lost and doesnt trigger a sessionProposal event, I think there is an issue with the relayer subscription of wallet connect and the event emitter is not emitting the session proposal event, It also doesnt return a status of what actually happened inside the code.
The relayer doesnt send the event in the below session proposal event listener
web3WalletClient.on('session_proposal', onSessionProposal);
}, []);
However, the pair function goes into a loop for valid cases, If its a invalid URI, it is returning a Error as Invalid URI but for the else case it gets lost and doesnt trigger a sessionProposal event, I think there is an issue with the relayer subscription of wallet connect and the event emitter is not emitting the session proposal event, It also doesnt return a status of what actually happened inside the code.
Can you guys try resolving this on a prioirity, or is there any way to check the events of the relayer ?
Beta Was this translation helpful? Give feedback.
All reactions