walletconnect-monorepo icon indicating copy to clipboard operation
walletconnect-monorepo copied to clipboard

Failing to receive signature from Gnosis Safe multisig app

Open eugenPtr opened this issue 10 months ago • 4 comments

Describe the bug

I am building an app that needs to be able to receive messages signed with Gnosis Safe While this worked well with Metamask, I am getting a Request expired. Please try again. error when I do it through Gnosis Safe. I have tested this on Sepolia, signing the message right away and having the tx confirmed by Safe in under 1 minute. The app keeps waiting to receive the signature from WC until the request times out.

To fetch the signature I am using signMessageAsync from wagmi's useSignMessage hook.

SDK Version (if relevant)

  • @web3modal/wagmi - 4.1.6
  • wagmi - 2.5.19

To Reproduce Steps to reproduce the behavior:

  1. Login through WC with Safe Wallet on Desktop
  2. User clicks a button requesting them to Sign a message
  3. User is redirected to the Safe wallet page in the browser
  4. User signs tx which gets confirmed less than a minute after
  5. User then goes to the app when a loader is spinning until the signature is received
  6. After a few minutes the browser console logs the error: Request expired. Please try again

Expected behavior The signature is received after a while, before timing out

eugenPtr avatar Apr 19 '24 16:04 eugenPtr

hey @eugenPtr session requests have default expiry of 5 minutes. Is it taking longer for you to sign?

ganchoradkov avatar Apr 22 '24 08:04 ganchoradkov

hey @ganchoradkov, thanks for picking this up. It's taking under a minute to sign and see the transaction confirmed.

eugenPtr avatar Apr 22 '24 08:04 eugenPtr

@ganchoradkov any idea what the issue could be here?

eugenPtr avatar Apr 23 '24 12:04 eugenPtr

Please update Wagmi and Web3Modal packages to latest. Feel free to repoen if the issue persists.

glitch-txs avatar Jul 06 '24 01:07 glitch-txs

I'm experiencing this same issue where useSignMessage, WalletConnect, and Gnosis Safe doesn't detect the Safe contract's emitted SignMsg event and hangs in pending until timing out.

I'm using wagmi latest (2.10.9), @walletconnect/ethereum-provider latest (2.13.3), and @walletconnect/modal latest (2.6.2).

ryanberckmans avatar Jul 07 '24 11:07 ryanberckmans

Not one of the wallets and connectors work

Starfeathers71 avatar Jul 07 '24 12:07 Starfeathers71

I'm experiencing this same issue where useSignMessage, WalletConnect, and Gnosis Safe doesn't detect the Safe contract's emitted SignMsg event and hangs in pending until timing out.

I'm using wagmi latest (2.10.9), @walletconnect/ethereum-provider latest (2.13.3), and @walletconnect/modal latest (2.6.2).

I ended up "solving" this by writing a wrapper library that polls for the creation of the eip-1271 hash via useReadContract in parallel with the useSignMessage. Then I abort the pending useSignMessage when the eip-1271 hash becomes available.

ryanberckmans avatar Jul 09 '24 18:07 ryanberckmans

@ryanberckmans do you mind sharing the workaround?

eugenPtr avatar Jul 10 '24 06:07 eugenPtr

I'm not able to repro in the latest: https://lab.web3modal.com/library/wagmi/

I'm able to sign a message with Safe succefully.

glitch-txs avatar Jul 11 '24 02:07 glitch-txs

please provider a MRE

glitch-txs avatar Jul 11 '24 02:07 glitch-txs