MetaMask / metamask-mobile

Mobile web browser providing access to websites that use the Ethereum blockchain
https://metamask.io
Other
2.15k stars 1.11k forks source link

[Bug]: empty personal_sign message on plaintext `message` #11508

Open christopherferreira9 opened 1 week ago

christopherferreira9 commented 1 week ago

Describe the bug

When requesting a personal_sign RPC the message is currently empty in the confirmation screen when using plaintext instead of hex. This used to be supported and historically, the SDK has been using plaintext directly in the helper connectAndSign method.

Expected behavior

No response

Screenshots/Recordings

https://github.com/user-attachments/assets/c8c7bb50-e3f0-4257-ba91-9f94ad5fa719

Steps to reproduce

  1. Go to https://mmsdk-test-dapp.vercel.app/ on your desktop browser
  2. Tap connectAndSign
  3. Scan the QR code
  4. Approve the connection
  5. See error

Error messages or log output

No response

Detection stage

On the development branch

Version

7.31.0

Build type

None

Device

iPhone 11

Operating system

iOS, Android

Additional context

No response

Severity

No response

christopherferreira9 commented 1 week ago

Can be related to: https://github.com/MetaMask/metamask-mobile/pull/11169

bschorchit commented 2 days ago

Hey @christopherferreira9, could the SDK team use the hex format for the connectAndSign method? Personal sign should accept hex only formats. We might have unintentionally accepted plain text format in the past.

https://docs.metamask.io/wallet/reference/personal_sign/