Hi Team,
I came across some unexpected behavior while using the Web Modal SDK.
Behavior:
I get a Proposal expired error (from WalletConnectV2Adapter) after 5 minutes when connecting with an external wallet option that is not Wallet Connect. The modal then opens again, and if I try to login I get an Already connected error.
I get the same Proposal expired error if I just open the modal, click on the Connect with Wallet button and then close the modal. If I connect through the Wallet Connect option everything is fine.
After some investigation I suspect that clicking the Connect with Wallet button initializes a Wallet Connect session (also showing the QR code). Connecting with Wallet Connect then fulfills the session flow correctly, while selecting a different option (or just closing the modal) leaves the session unhandled, resulting in the Proposal expired error after the 5 minute timeout. Just wanted to mention my thoughts in case it would be of any help.
Steps to reproduce:
- Open modal
- Click on Connect with Wallet button
- Connect with Metamask or just close the modal
After 5 minutes the Proposal expired error gets triggered from WalletConnectV2Adapter and the modal window opens again.
Expected behavior:
Error does not get triggered and the modal remains closed.
More details:
- SDK Version: 6.1.3
- Developed in: Next.js 13
- Platform: Google Chrome browser on Windows 11
- Browser Console Screenshot:
Web3Auth initialization and login code snippet:
I use the standard flow, as demonstrated in the documentation. I also tried configuring the WalletConnectV2Adapter myself, but the result remains the same.
Initialization:
const web3auth = new Web3Auth({
clientId: WEB3AUTH_CLIENT_ID,
web3AuthNetwork: “mainnet”,
chainConfig: {
chainNamespace: “eip155”,
chainId: “0x1”,
rpcTarget: “https://rpc.ankr.com/eth”,
},
});await web3auth.initModal();
setWeb3Auth(web3auth);
Login:
const web3authProvider = await web3Auth.connect();
Thank you for your help in advance!