GithubHelp home page GithubHelp logo

In the useLogin react hook, when the user cancel the signing message modal, an unhandled promise is being thrown instead of being handled by the SDK about lens-sdk HOT 14 CLOSED

lens-protocol avatar lens-protocol commented on August 28, 2024
In the useLogin react hook, when the user cancel the signing message modal, an unhandled promise is being thrown instead of being handled by the SDK

from lens-sdk.

Comments (14)

reecejohnson avatar reecejohnson commented on August 28, 2024 1

thanks for raising this @pradel

i was able to reproduce this, thanks for the detailed reproduction steps.

we are taking a look into the cause now.

i will keep update this issue once resolved 👍

from lens-sdk.

cesarenaldi avatar cesarenaldi commented on August 28, 2024 1

#806

from lens-sdk.

cesarenaldi avatar cesarenaldi commented on August 28, 2024 1

Fix for this available in: @lens-protocol/[email protected] and @lens-protocol/[email protected]

from lens-sdk.

reecejohnson avatar reecejohnson commented on August 28, 2024

@pradel see mentioned PR for small fix that better handles this error

this is not related directly to our React SDK but more so an issue with our example app using wagmi and viem

we do already handle the case where a user rejects the request in the login flow

this error was coming from before the login flow was executed, in the connection of the wallet to example app

i've added an onError callback to this example to better handle this case

from lens-sdk.

pradel avatar pradel commented on August 28, 2024

@reecejohnson from my tests the error is coming from the login flow (when you sign a message), not the connect flow. It was working properly with the V1 of the SDK but not with the V2 so maybe a regression?

from lens-sdk.

reecejohnson avatar reecejohnson commented on August 28, 2024

@pradel i see, can you provide some information around which wallet you're using? and a screen recording if possible

from lens-sdk.

cesarenaldi avatar cesarenaldi commented on August 28, 2024

@pradel any update on this?

from lens-sdk.

pradel avatar pradel commented on August 28, 2024

The issue is still happening with the latest version, I am using Taho Wallet and it can be reproduced in the lens example consistently https://lens-sdk-example-web-wagmi.vercel.app/login

from lens-sdk.

pradel avatar pradel commented on August 28, 2024

@cesarenaldi @reecejohnson this is the video showing the issue I am facing.

Screen.Recording.2024-01-03.at.19.08.02.mov

from lens-sdk.

cesarenaldi avatar cesarenaldi commented on August 28, 2024

@pradel thank you for the video, this is now more clear. Internally the SDK uses ethers.js, it seems something is not working with the RPC wallet error codes and ethers.js error codes mapping.

We will need to investigate this further to assess if this can be patched or requires to upgrade ethers.

We will get back to you when we know more. Thank u for now.

from lens-sdk.

cesarenaldi avatar cesarenaldi commented on August 28, 2024

@pradel we will be able to allocate proper time to look into this next week.

I understand this is happening only in the very particular circumstance that a user refuse (from their Taho Wallet) to sign the login challenge text. So seems to not affect the rest of the app experience when the user wants instead to continue w/ login. Is this correct?

from lens-sdk.

pradel avatar pradel commented on August 28, 2024

Correct, it's not critical as the user can continue the flow as usual.

from lens-sdk.

pradel avatar pradel commented on August 28, 2024

@cesarenaldi just tested with Rabby wallet and the same issue is happening. I think this used to work fine with the v1 of the SDK but not 100% sure.

from lens-sdk.

cesarenaldi avatar cesarenaldi commented on August 28, 2024

Hey @pradel thank you, I managed to spot the issue using Rabby. Will include a fix in the next SDK release.

from lens-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.