WalletConnect / web3modal

A single Web3 provider solution for all Wallets
https://web3modal.com
Apache License 2.0
4.72k stars 1.32k forks source link

Connection Failure on First Attempt with Web3Modal and Polygon #2466

Open socheatleang opened 3 days ago

socheatleang commented 3 days ago

Link to minimal reproducible example

https://github.com/WalletConnect/react-native-examples/tree/main/dapps/W3MEthers5

Summary

Basically, I just clone react-native project from the example repo.

When attempting to connect to the Polygon Amoy network using the Web3Modal library with @web3modal/ethers5-react-native, the connection fails on the first attempt. The connection only succeeds after terminating and reopening the application. This issue occurs consistently and has been verified under various network conditions and app states.

Steps to Reproduce

  1. Initialize Web3Modal with @web3modal/ethers5-react-native configured for the Polygon Amoy or polygon network.
  2. Attempt to connect to MetaMask on the first application launch.
  3. Observe the failure to connect.
  4. Terminate the app and reopen it.
  5. Attempt to connect again and observe a successful connection.

Expected Behavior

The connection to MetaMask via Web3Modal should succeed on the first attempt without needing to restart the application after download/launch the new app

Actual Behavior

The connection fails on the first attempt and only succeeds after the application is restarted..

List of related npm package versions

"@walletconnect/client": "^1.8.0",
"@walletconnect/react-native-compat": "^2.13.3",
"@walletconnect/react-native-dapp": "^1.8.0",
"@walletconnect/web3-provider": "^1.8.0",
"@web3modal/ethers5-react-native": "^1.4.1",
"ethers": "5.7.2",
"expo": "~48.0.21",
"react-native": "0.71.14",
linear[bot] commented 3 days ago

APKT-662 Connection Failure on First Attempt with Web3Modal and Polygon