Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Async call fails to return to Dapp #979

Open
muscleman opened this issue Aug 10, 2024 · 14 comments
Open

[Bug]: Async call fails to return to Dapp #979

muscleman opened this issue Aug 10, 2024 · 14 comments
Assignees
Labels
Bug Triage Issues to be triaged in the next session

Comments

@muscleman
Copy link

SDK

Node.js

Provide environment information

works fine for me in Missouri, Does not work for my tester in St Louis or Poland

MetaMask SDK Version

0.27.0

MetaMask Mobile app Version

7.27.1 (1369)

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

pure js provided

Describe the Bug

the first call to approve a spending cap never returns execution back to the calling application.

So the next call to spend the allowance never gets called.

weird thing, when i run this it works. when my tester run this it doesn't return.

if they cancel the allowance/spend cap, execution returns to the app.

Expected Behavior

user can approve a spending cap, execution returns to my app and the user then approves my bridge to spend and burn the allowance.

Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster

https://github.com/muscleman/web3-tester

To Reproduce

run tester app.

app invokes the following method.
await tokenContract.methods.approve(this.bridge_address, web3.utils.toWei(1, "ether")).send({ from: tokenWalletAddress })

approve the spending cap in the mobile wallet

never returns execution in the app, no further code is executed.

when i run this locally, all works fine.

now, for me running the script, all works fine.

@muscleman
Copy link
Author

You'll need to give me a test eth account and i'll send you some eXEQ tokens for testing

@christopherferreira9 christopherferreira9 added the Bug Triage Issues to be triaged in the next session label Aug 12, 2024
@SimonPhoenix1985
Copy link

Same for me!
On Android from Chrome mobile I am sending 'eth_sendTransaction' for spending cap and this Promise never resolves despite the fact that in Metamask app that transaction was successful.

@muscleman
Copy link
Author

any updates on this @abretonc7s

@SimonPhoenix1985
Copy link

I did some tests with cap. So:

  • in Chrome extension transaction is very fast and Promise resolves
  • on IOS (Iphone 11) - transaction is very fast and Promise resolves (but you have to return manually to the browser)
  • on Android - cap transaction is stucking every time. No Promise resolve and no return.

@muscleman
Copy link
Author

the tes app i provided is not using the browser. its javascript to metamask mobile wallet.

@SimonPhoenix1985
Copy link

It doen't matter, app or mobile browser.

@muscleman
Copy link
Author

and one of my testers is using iphone and it's not returning.

@BigslimVdub
Copy link

Can confirm not working on iOS latest MetaMask app 7.28.0 on ip13 pro and latest iOS 17.6.1.
@SimonPhoenix1985 what iOS ver are you using? 17 includes some fun security features

@SimonPhoenix1985
Copy link

Iphone 11, IOS 17.5.1, chrome mobile browser. In Metamask app after cap transaction I got "Go back to app" message and I have to go back manually, but Promise resolves.

@SimonPhoenix1985
Copy link

@muscleman @BigslimVdub
So, I think I've resolved the issue.
In Metamask app->settings->advanced->smart transactions
if this option is ON - it won't work, if you turn in OFF - Promise resolves

@muscleman
Copy link
Author

actually on my iphone 14 this setting is on and it works for me
european tester had his on and did not work

@BigslimVdub
Copy link

@muscleman @BigslimVdub So, I think I've resolved the issue. In Metamask app->settings->advanced->smart transactions if this option is ON - it won't work, if you turn in OFF - Promise resolves

Hmm I just tried this with smart transactions off and it worked first try, no issues or delays

@SimonPhoenix1985
Copy link

But still there is a bug in Metamask app with smart transactions, it does not resolve Promise, need to be fixed

@christopherferreira9
Copy link
Collaborator

Hi all!
This may have been caused by smart transactions being enabled in all chains. Since 7.30, Smart transactions are only available on Mainnet currently so setting them ON or off should not have any effect.
Can you please give this a try with the latest version of the MetaMask MObile Wallet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Triage Issues to be triaged in the next session
Projects
None yet
Development

No branches or pull requests

5 participants