MetaMask / metamask-sdk

The simplest yet most secure way to connect your blockchain-based applications to millions of MetaMask Wallet users.
https://metamask.io/sdk/
Other
165 stars 101 forks source link

Eth request accounts sometimes throws -> Message ignored because invalid key exchange status #262

Closed bearsworth closed 1 year ago

bearsworth commented 1 year ago

Describe the bug When metamask connection status goes to disconnected, you are prompted to use eth_requestAccounts again.

When you do eth_requestAccounts request after disconnection, it redirects to the Metamask Mobile Wallet and you are sent an error that says

"Message ignored because invalid key exchange status BLt4PBvgg....key"

Followed by the app not forwarding back to your mobile app (in this case a react-native app).

To Reproduce Steps to reproduce the behaviour:

  1. Use the reactNativeDemo
  2. When metamask is disconnnected, reconnect.
  3. See the error.

Expected behaviour

The mobile sdk should not hang and redirect back with an error rather than stay on the mobile wallet app.

Screenshots If applicable, add screenshots to help explain your problem.

Provide environment information

Additional context Add any other context about the problem here.

ikedm commented 1 year ago

@bearsworth did you close this because you found a solution? I'm experiencing the same issue

bearsworth commented 1 year ago

@bearsworth did you close this because you found a solution? I'm experiencing the same issue

I wasn't able to determine if it's a bug or a network issue. It does still happen sometimes when I'm testing. I would re-open the issue -> something leads me to believe they should move away from polling architecture.

I closed it mostly because manually terminating the SDK seemed to have helped overcome the issue. Now the issue happens that you'll get "waiting" sometimes to infinity in the mobile app...

If they have a chance, they should follow the Coinbase mobile sdk. It works effortlessly -> except right now they block send transactions for certain cases.