metamask-mobile icon indicating copy to clipboard operation
metamask-mobile copied to clipboard

[Bug]: eth_sendTransaction ends with "Invalid Id" error

Open Sabriel1984 opened this issue 1 year ago • 3 comments

Describe the bug

I have the same issue as reported here: https://github.com/MetaMask/metamask-mobile/issues/6735 and here https://github.com/MetaMask/metamask-mobile/issues/6736 - eth_sendTransaction ends with:

onSessionRequestResponse SessionRequestResponse(topic=73e8b38daa81df141fd0cef805fc0ea877b2a122e0b3a987d0d252f3b8589e09, chainId=eip155:11155111, method=eth_sendTransaction, result=JsonRpcError(id=1718966885359214, code=1, message=Invalid Id))

when I use metamask - it looks like a kind of regression in last metamask versions - currently we're not able to send transactions using this wallet. From the other side, when we send the same transaction (we have WalletConnect library to support different wallets) via DeFi wallet it works perfectly. I have the same error on both iOS and Android - and it's a kind of release blocking issue for us.__

Expected behavior

after send transaction event it should be a popup to confirm transaction in metamask wallet

Screenshots/Recordings

No response

Steps to reproduce

try to send eth_sendTransaction (I'm using Sepholia network if it's important), check logs with error

Error messages or log output

No response

Version

7.24.3

Build type

None

Device

Pixel 6a and others - not related this device

Operating system

Android

Additional context

No response

Severity

No response

Sabriel1984 avatar Jun 24 '24 06:06 Sabriel1984

Hi @Sabriel1984 ! Do you have a dapp we can test this with? I've just tried a test dapp provided by WalletConnect and it seems to work normally.

https://github.com/MetaMask/metamask-mobile/assets/104831203/5f66c59c-a8d0-463e-a69b-5f2c0f285cfc

christopherferreira9 avatar Jun 24 '24 13:06 christopherferreira9

Get the same problems when I try to signTypedMessage with MetaMask in Safari (redirecting to mobile's MetaMask App)

  1. Open my Dapp in Safari
  2. Connect Wallet
  3. Redirect to MetaMask and Connect
  4. Back to my Dapp
  5. Try to sign typed message
  6. get Error with
     {"error":{"code":1, "message": "Invalid Id"}
    

I'm using @web3modal with ethers5 with MetaMask mobile version: 7.24.3

I also test previous version of MetaMask. There is no problem with 7.21.0

boxi79 avatar Jun 25 '24 12:06 boxi79

Hi @christopherferreira9, if you give me your email I could invite you to our app beta testing process on Test Fairy and Test Flight. But maybe transaction request will help you

WalletManagerImpl sendTransactionRequest success WalletConnect(method=eth_sendTransaction, params=[{"from":"0xfba2964efc69565d58b3429254db3225cf701035","to":"0x4BDDf9D49F7bE9957f60B5ce17ee32cf3d4A2107","value":"0x0", "data":"0x095ea7b3000000000000000000000000150b1ea321a42a934cbc970a7cf015dbac34b752000000000000000000000000000000000000000000000008e962295c87f43d30"}], chainId=eip155:11155111, requestId=1719577549980500, sessionTopic=a15dc9097a891024c2a53da98ed4fcb8fcc1f88df784b12e3ce40bbdab4a837f)

so basically I use eth_sendTransaction with only from, to and data filled (value is always 0 and it's not required) - becuase we try to send our token (by dapp with wallet connect library) from client metamask wallet to our smart contract address - so I have smart contract abi encoded and filled with values in "data" field

And it used to works lets say often in previous wallet versions (so in most cases dialog appears - if not there was no error in logs), but on latest 7.24 version it completely stop working - and I always have this error in logs:

WalletManagerImpl onSessionRequestResponse SessionRequestResponse(topic=a15dc9097a891024c2a53da98ed4fcb8fcc1f88df784b12e3ce40bbdab4a837f, chainId=eip155:11155111, method=eth_sendTransaction, result=JsonRpcError(id=1719577549980500, code=1, message=Invalid Id))

I checked and for the same params by web browser - https://docs.metamask.io/wallet/reference/eth_sendtransaction - it seems to work perfectly - so it must by regression in mobile metamask app. I also use another wallet (DeFi crypto.com) and the same transaction works without any problems.

If anyone from metamsk devs needs help with debug this issue using our dapp please send me a private message or send me an email.

Sabriel1984 avatar Jun 28 '24 12:06 Sabriel1984

Hi @Sabriel1984 ! Do you have a dapp we can test this with? I've just tried a test dapp provided by WalletConnect and it seems to work normally.

Screen.Recording.2024-06-24.at.14.57.14.mov

Hi @Sabriel1984 ! Do you have a dapp we can test this with? I've just tried a test dapp provided by WalletConnect and it seems to work normally.

Screen.Recording.2024-06-24.at.14.57.14.mov

any progress here? are you able to reproduce an issue?

Sabriel1984 avatar Jul 02 '24 14:07 Sabriel1984

@Sabriel1984 I'm really struggling to reproduce this. Are you able to share a request sample? I just tried with web3modal and ethers5 with this request:

const to = '0x4BDDf9D49F7bE9957f60B5ce17ee32cf3d4A2107'
    const transactionParameters = {
      to,
      from: address,
      value: '0x0',
      data: '0x095ea7b3000000000000000000000000150b1ea321a42a934cbc970a7cf015dbac34b752000000000000000000000000000000000000000000000008e962295c87f43d30'
}

const ethersProvider = new ethers.providers.Web3Provider(walletProvider)
await ethersProvider.provider.request({
    method: 'eth_sendTransaction',
    params: [transactionParameters]
})

Also tried with 7.21.0 until 7.24 and all of them worked properly.

christopherferreira9 avatar Jul 11 '24 17:07 christopherferreira9

@christopherferreira9 I gave you request sample in my post above:

method=eth_sendTransaction,

params=[{"from":"0xfba2964efc69565d58b3429254db3225cf701035","to":"0x4BDDf9D49F7bE9957f60B5ce17ee32cf3d4A2107","value":"0x0", "data":"0x095ea7b3000000000000000000000000150b1ea321a42a934cbc970a7cf015dbac34b752000000000000000000000000000000000000000000000008e962295c87f43d30"}],

but as I said before - I can easily reproduce it using Android wallet connect library with metamask versions 7.23 and 7.24 - on 7.21 it works perfect on Android. On iOS I also have seen "Invalid id" error but I'm not sure on which metamask wallet version, and also in case of iOS I wasn't able to work with other wallets so I suspended iOS platform for now.

Sabriel1984 avatar Jul 16 '24 12:07 Sabriel1984

@christopherferreira9 我在上面的帖子中为您提供了请求示例:

方法=eth_sendTransaction,

参数 = [{“来自”:“0xfba2964efc69565d58b3429254db3225cf701035”,“至”:“0x4BDDf9D49F7bE9957f60B5ce17ee32cf3d4A2107”,“值”:“0x0”,“数据”:“0x095ea7b300000000000000000000000000150b1ea321a42a934cbc970a7cf015dbac34b752000000000000000000000000000000000000000000000000000000000008e962295c87f43d30”}],

但正如我之前所说 - 我可以使用 Android 钱包连接库和 metamask 版本 7.23 和 7.24 轻松重现它 - 在 7.21 上它在 Android 上运行完美。在 iOS 上我也看到了“无效 ID”错误,但我不确定是在哪个 metamask 钱包版本上,而且在 iOS 上我无法与其他钱包一起使用,所以我暂时暂停了 iOS 平台。

Hello, I also encountered this problem, have you found a solution?

cicada-cn avatar Aug 13 '24 08:08 cicada-cn

This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 7 days. Thank you for your contributions.

github-actions[bot] avatar Nov 11 '24 08:11 github-actions[bot]

This issue was closed because there has been no follow activity in 7 days. If you feel this was closed in error please provide evidence on the current production app in a new issue or comment in the existing issue to a maintainer. Thank you for your contributions.

github-actions[bot] avatar Nov 18 '24 08:11 github-actions[bot]