Page MenuHomePhabricator

[web] fix uncaught exception when user cancels SIWE
ClosedPublic

Authored by varun on Jun 21 2024, 4:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Sep 16, 7:15 AM
Unknown Object (File)
Mon, Sep 16, 3:38 AM
Unknown Object (File)
Mon, Sep 16, 12:00 AM
Unknown Object (File)
Thu, Sep 12, 10:50 AM
Unknown Object (File)
Tue, Sep 10, 7:18 PM
Unknown Object (File)
Tue, Sep 10, 1:38 PM
Unknown Object (File)
Tue, Sep 10, 5:04 AM
Unknown Object (File)
Tue, Sep 10, 1:14 AM
Subscribers

Details

Summary

if a user cancels the request to sign the SIWE message from their wallet, we get an uncaught exception. wrap the call to signMessage with a try-catch to fix this bug

Depends on D12548

Test Plan

canceled SIWE message signing from my wallet and didn't get an uncaught exception

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

varun requested review of this revision.Jun 21 2024, 5:13 PM

Can any other errors be thrown by signer.signMessage? Should we still throw them if so?

In D12549#355466, @inka wrote:

Can any other errors be thrown by signer.signMessage? Should we still throw them if so?

I think we have to swallow the error here no matter what. If we re-throw, we get an uncaught exception error. Regardless of the error, the user will have to click the sign in button again to be prompted to sign a new message from their wallet

This revision is now accepted and ready to land.Jun 24 2024, 10:17 AM