Comments (8)
CR-15 pair() doesn't work for valid URIs in React Native / Android
from walletconnect-monorepo.
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.
Hey @preetish-brine, could you double check that you're passing valid/unused pairing URI please. The pair
method creates pairing and subscribes to the topic provided in the URI. If that topic was already subscribed by another client and proposal was consumed, you will not receive it second time.
from walletconnect-monorepo.
Additionally, please make sure that you're subscribed to receive session_proposal
before you call .pair
as you could be running into race conditions due to the reliance on useEffects (judging from the snippets above)
from walletconnect-monorepo.
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.
Hey @preetish-brine, could you double check that you're passing valid/unused pairing URI please. The
pair
method creates pairing and subscribes to the topic provided in the URI. If that topic was already subscribed by another client and proposal was consumed, you will not receive it second time.
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
from walletconnect-monorepo.
Additionally, please make sure that you're subscribed to receive
session_proposal
before you call.pair
as you could be running into race conditions due to the reliance on useEffects (judging from the snippets above)
@ganchoradkov
Yes my subscription logic is same as it was for the signClient
useEffect(() => {
if (initialized) {
console.log("INIT_WEB3", web3WalletClient);
web3WalletClient.on('session_proposal', onSessionProposal);
web3WalletClient.on('session_request', onSessionRequest);
// TODOs
web3WalletClient.on('session_ping', (data) => console.log('ping', data));
web3WalletClient.on('session_event', (data) => console.log('event', data));
web3WalletClient.on('session_update', (data) => console.log('update', data));
web3WalletClient.on('session_delete', (data) => {
// console.log('delete', data);
// showInfoNotification('Dapps successfully disconnected!');
});
}
}, [initialized, onSessionProposal, onSessionRequest]);
from walletconnect-monorepo.
It seems that both useEffects
- that sets the event listeners
- the one that calls pair
are run at the same time by initialized
potentially causing a race condition.
I would suggest to test the logic by having them in the same useEffect or check out our RN example wallets here https://github.com/WalletConnect/react-native-examples/tree/main/wallets
from walletconnect-monorepo.
It seems that both useEffects
- that sets the event listeners
- the one that calls pair
are run at the same time by
initialized
potentially causing a race condition. I would suggest to test the logic by having them in the same useEffect or check out our RN example wallets here https://github.com/WalletConnect/react-native-examples/tree/main/wallets
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
from walletconnect-monorepo.
@preetish-brine could you provide a minimal reproducible example of the issue please?
from walletconnect-monorepo.
Related Issues (20)
- Failing to receive signature from Gnosis Safe multisig app HOT 4
- React Native Push Notification Not working HOT 5
- Can't resolve 'pino-pretty' when installing `@walletconnect/ethereum-provider` with pnpm HOT 5
- Domain verification is incorrectly generated for `.it.com` TLD HOT 7
- rpc.walletconnect error "method not supported eth_uninstallFilter" HOT 1
- Hey @juloxrox, thanks for reaching out. You can access the same exported members by using the methods in `modal` object which is created with the `createWeb3Modal` function. HOT 1
- echo "# Lccrazy666" >> README.md git init git add README.md git commit -m "first commit" git branch -M main git remote add origin https://github.com/Lccrazy666/Lccrazy666.git git push -u origin mai HOT 1
- Problem on mobile device HOT 1
- getActiveSessions continues to return disconnected session HOT 2
- Add a chain: Telcoin Testnet - "Adiri" HOT 1
- Error for initializing [TypeError: Cannot read property 'Core' of undefined] HOT 3
- Add Saakuru blockchain HOT 1
- Add Polymesh as a supported chain HOT 1
- Add Sentience Wallet to list of Wallets HOT 1
- Add Endurance mainnet HOT 1
- Bug report HOT 2
- Fix bug HOT 3
- Add BounceBit Mainnet HOT 1
- Unable to Perform Actions on BounceBit Chain HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from walletconnect-monorepo.