metamask-mobile
metamask-mobile copied to clipboard
Attempting to Pancake swap closed MMM when using Ledger address
Description
On the first attempt, the Ledger device had went into screen saver mode. When I attempted to complete a swap, MMM simply closed and returned me to the login page. On second attempt, was able to complete a swap.
This ticket is specifically for step 21 into 22 below: User taps confirm on transaction just after Ledger screensaver starts, and MMM closes and brings user to login page.
iPhone 13 mini Running iOS 15.6.1 MMM build 952 Ledger Nano X firmware 2.0.2
Reproduction steps
- Have MMM with Ledger paired
- Have some amount of BNB (native) token
- unlock Ledger
- Unlock MMM and be at wallet view
- Be on Mainnet
- Navigate to pancakeswap.finance
- Tap connect
- Tap MetaMask
- Tap Connect
- Note that the Switch Network modal opens briefly but then closes
- Tap connect again
- Tap MetaMask again
- Tap "Switch Network"
- Tap "Trade"
- Scroll around in asset selection
- Go back to wallet view
- From there, return to Browser
- Enter amount of BNB to swap
- Tap "Swap"
- Tap "Confirm Swap"
- Tap "Confirm" moments after the Ledger screensaver turns on
- Watch MMM reload and bring user to login page
- Unlock MMM
- Unlock Ledger
- Go to Browser
- Dismiss ENS error (because I had Uniswap.eth opened in another browser tab but am not on mainnet)
- Go to wallet view
- Go to drawer and then tap "View on BSCscan"
- Go back to browser
- Enter amount to swap
- Tap "Swap"
- Tap "Confirm Swap"
- Tap "Confirm"
- Review tx and "Accept and send" from Ledger
Acceptance Criteria
- If user attempts to confirm transaction after Ledger device screensaver begins, an error message should be presented suggesting the user unlock the Ledger device.
Scenario: Swap transaction confirmed just after screensaver begins
- GIVEN a user has a Ledger device paired with the MMM wallet
- WHEN a user attempts to swap on pancakeswap.finance
- AND the Ledger screensaver starts just before the transaction is confirmed on MMM Confirm modal
- THEN an error should be presented to unlock the Ledger device
- AND the MMM app does not restart
References
- https://recordit.co/qcre6ZL1PP
Just an update that I was able to reproduce this on a subsequent swap attempt using a non-native asset on BNB network with pancake swap. When I attempt to enable an asset for trading while the Ledger device screensaver is active and the device is locked, MMM simply closes and returns the user to the login page. I am subsequently able to retry and complete these actions after unlocking the device. https://recordit.co/F9KcRpl6ND
I can produce similar behavior in attempting to use Uniswap right after the Ledger screensaver turns on and the device is locked: https://recordit.co/VlzfqPRIek
In a totally different use case where the user is attempting to send ETH on a testnet to another EOA, the transaction seems to disappear if sent to Ledger right after the screensaver/PIN lock occurs: https://recordit.co/IH4pN2RGwt
Finally, when attempting to pair MMM with the Ledger while the Ledger screensaver is enabled and the device is locked, pairing fails and no error is presented. The user is simply returned to "connect a hardware wallet": https://recordit.co/RYepZV9tAz
There is an opportunity to handle a screensaver/locked Ledger device in a way that avoids the mobile wallet closing and support a more informative error to inform the user how to proceed.
There might be an issue using Pancake swap when a token spending approval is required to swap out of non-native assets. I am seeing the app close when trying to send the token spending approval to Ledger, without fooling with screen/pin lock.
Android 12 Pixel 3a MMM build 952
Ledger settings - Blind signing: enabled - Debug data: Not displayed - Nonce: Displayed
When I tap "approve" on the spending limit modal, I see the location permission request and then the app closes.
Trying to approve UNI: https://recordit.co/z6fKtFjrzA - at 39s (returns user to Chrome browser) - at 1m26s ("MetaMask keeps stopping") - at 2m15s (returns user to home)
Trying to approve Doge-BNB: https://recordit.co/1o4M8gS84P - 1st attempt at 1m02s results in "Your device got disconnected" - tapping "Try again" appears to work, but was never actually broadcast to network
This is a function on a non Ethereum chain so this feature could be unsupported. The Ledger Ethereum app just supports Ethereum, not all EVM chains.
This issue was closed because it has been stalled for 7 days with no activity. If you feel this was closed in error please reopen and provide evidence on the current production app. Thank you for your contributions.