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

[Bug]: MetaMask stops when pairing request is rejected from Ledger Nano X

Open plasmacorral opened this issue 1 year ago • 1 comments

Describe the bug

Observed in RC 1 testing for 7.17.0 on Pixel 5a with android 14: When initiating add hardware for Ledger if the user declines the pairing request from the Ledger device, MetaMask stops.

Expected behavior

MetaMask handle user rejection of pairing gracefully, and provide actionable instructions in an error message.

Screenshots/Recordings

Stopped

Recording: https://recordit.co/Y4JaFbIsEe

Steps to reproduce

  1. From Android settings>connected devices> see all make sure LNX not currently paired
  2. Have LNX unlocked and the Ethereum app opened
  3. Unlock MMM
  4. Tap accounts menu from wallet view
  5. Select add account or hardware wallet
  6. Tap Add hardware wallet
  7. Tap Ledger
  8. Grant location permission with Only this time
  9. Tap Continue when LNX is found
  10. From LNX select Cancel pairing
  11. Note app closes
  12. On second attempt, note MetaMask keeps stopping

Error messages or log output

No response

Version

7.17.0

Build type

None

Device

Pixel 5a with android 14

Operating system

Android

Additional context

iOS device presents no error on first rejection, but then gives a generic error when the second attempt to pair is rejected from the LNX device.

Severity

No response

plasmacorral avatar Feb 20 '24 21:02 plasmacorral

Related to https://github.com/MetaMask/metamask-mobile/pull/8246

plasmacorral avatar Feb 22 '24 02:02 plasmacorral

This was an Edge case previously deprioritised after the first release, as it requires a new update mechanism from Ledger. Reference ticket https://app.zenhub.com/workspaces/cet-metamask-hardware-wallets-6566ee6aedc46007d5a260bb/issues/zh/111

angelcheung22 avatar Feb 27 '24 10:02 angelcheung22

Lets add timeout.

angelcheung22 avatar Feb 27 '24 12:02 angelcheung22

@vivek-consensys lets discuss why this is moved to blocked?

angelcheung22 avatar Mar 05 '24 09:03 angelcheung22

The app crash was caused by bluetooth disconnected error thrown from native code. so timeout implementation will not work here.

We need to find a way to catch this bluetooth disconnected exception to prevent this app crash happening again.

dawnseeker8 avatar Mar 05 '24 12:03 dawnseeker8

Tested locally with no app crashes on Samsung Android 13, flows tested include;

  1. Reject from LNX without accepting or declining pairing on MMM app
  2. Reject from LNX and decline pairing on MMM app
  3. Accept pairing on MMM app and accept from LNX

Private Zenhub Video

vivek-consensys avatar Mar 07 '24 10:03 vivek-consensys

pending https://github.com/MetaMask/metamask-mobile/pull/8887

angelcheung22 avatar Mar 12 '24 10:03 angelcheung22

related fix https://github.com/MetaMask/metamask-mobile/pull/8873

angelcheung22 avatar Mar 12 '24 10:03 angelcheung22