WalletConnect / WalletConnectFlutterV2

WalletConnect v2 client made in Dart for Flutter.
https://pub.dev/packages/walletconnect_flutter_v2
Apache License 2.0
105 stars 60 forks source link

Issues with reconnecting session from saved pairing topic #315

Open OmniKobra opened 3 days ago

OmniKobra commented 3 days ago

Describe the bug Reconnecting a session from saved pairing topic causes issues with Web3App.request() eth_sendTransaction

To Reproduce 1- Connecting from trust wallet to my dApp 2- save pairing topic for reconnection in case of restarting app. 3-call Web3App.request(eth_sendTransaction..etc) with current session topic. 4- the request works and trust wallet prompts user to approve transaction. 5-Close app, start it up again 6- call Web3App.connect() with the pairing topic saved in step 2 => it succeeds 7- call Web3App.request same as in step 3, and receive the following error: Pairing _onMessageEvent, Received data: {id: 1726420638420461, jsonrpc: 2.0, error: {code: 5300, message: Invalid Session Properties requested}} printed as: JsonRpcError(code: 5300, message: Invalid Session Properties requested)

Expected behavior Expected to work same as first initial connection

Reproducible code

Screenshots This is where the error happens upon reconnection. Screenshot 2024-09-15 202707 Screenshot 2024-09-15 203252 Screenshot 2024-09-15 203138

Smartphone (please complete the following information): Platform agnostic, doesnt matter which device i test on it allways does the explained issue

Additional context Developing a dApp, testing with trust wallet and metamask, fuji testnet.

OmniKobra commented 3 days ago

Update: the logic works fine with metamask, issue seems to be from trust wallet.

quetool commented 2 days ago

Hello @OmniKobra! Any chance you can share a minimum reproducible code in text format? Also, about the point 6

call Web3App.connect() with the pairing topic saved in step 2 => it succeeds

You don't need to do that, it's everything handled by SDK, once you connect to a wallet you shouldn't need to care about saving the topic and reconnect, reconnection happens automatically.