Git Product home page Git Product logo

Comments (14)

jordaaash avatar jordaaash commented on August 12, 2024

I don't imagine this is actually a bug with the @ledgerhq/live-common library, that's just where these commands come from.

Maybe it could be an issue with the @ledgerhq/hw-transport-webhid or @ledgerhq/hw-transport libraries, but the disconnect event is being emitted on the browser's HIDDevice, so it seems most likely that some response from the device itself is causing the disconnection.

from ledger-live.

jordaaash avatar jordaaash commented on August 12, 2024

Doing some more testing, it looks like the disconnect event is also emitted on the transport just when quitting the running app manually.

from ledger-live.

jordaaash avatar jordaaash commented on August 12, 2024

Currently I'm working around this problem by waiting a short time after opening or quitting an app (4000 milliseconds seems to work) and creating a new WebHIDTransport instance to send the next command. If the new transport is created too quickly, the device won't appear in the list to reconnect immediately.

from ledger-live.

jordaaash avatar jordaaash commented on August 12, 2024

I've observed the same behavior with the WebBLETransport. In this case, the workaround of waiting a few seconds after opening or closing an app doesn't work. Because the bluetooth.requestDevice API requires user interaction, I can't just create a new transport instance to reconnect.

from ledger-live.

jordaaash avatar jordaaash commented on August 12, 2024

Related doc for these commands: https://developers.ledger.com/docs/transport/open-close-info-on-apps/

from ledger-live.

github-actions avatar github-actions commented on August 12, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label, comment, or consider closing it.

from ledger-live.

jordaaash avatar jordaaash commented on August 12, 2024

Please keep open and fix this, it's an active issue.

from ledger-live.

 avatar commented on August 12, 2024

@alexandremgo FYI

from ledger-live.

github-actions avatar github-actions commented on August 12, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label, comment, or consider closing it.

from ledger-live.

jordaaash avatar jordaaash commented on August 12, 2024

This is a bug and is not stale. Please take a look.

from ledger-live.

gre avatar gre commented on August 12, 2024

This is the correct behaviour of our hardware wallets i'm afraid and I'm not aware there is a plan to change anytime soon this behaviour. In Ledger Live we had to workaround the UX around this as well: we're actively waiting a reconnect after doing a openApp / closeApp – this was manageable with node-hid, but on the web i'm not experienced enough to know if it can be done without having to re-ask user's permission (so in a context of a click :s).
basically this comes from the fact an app running on ledger hardware wallet is responsible to create the connectivity stack (USB / BLE / HID / ..) which means each App Open is going to be similar to "plugging a new device" and each App Close is going to be similar to "unplugging that device", same goes with the device's dashboard (the main app screen where you see the apps).
When you obtain a transport, the lifecycle is not the actual usb wire connection but is the lifecycle of the device's app.

So entering an app from the dashboard is essentially a disconnect+connect on the USB stack.

from ledger-live.

jordaaash avatar jordaaash commented on August 12, 2024

Thanks for the response, @gre.

So entering an app from the dashboard is essentially a disconnect+connect on the USB stack.

I haven't found this issue to occur when the user initiates opening an app on the Ledger device (it does occur when exiting one though). It occurs when sending either command to the device over the connected web transport.

For example, I can connect to the device over either the Bluetooth or WebHID transport with the Dashboard open. If I try to send commands for the Solana app, they will fail but not disconnect the transport. If I then open the Solana app on the device, the transport will not disconnect, and subsequent commands to the Solana app will succeed.

Only if I quit the app on the device, or send the commands to quit the current app or open an app, will it cause transport disconnection. This makes these commands not very useful, as the UX of losing the transport connection is pretty bad. Is this expected behavior? What sort of UX do you recommend, for example always asking the user to launch the app themselves before connecting?

from ledger-live.

gre avatar gre commented on August 12, 2024

@jordaaash it's curious that you don't experience a disconnect when entering the app, i'm not familiar with the latest development on the matter so I've asked internally the relevant team who should answer here if they have complementary information 🙏

What sort of UX do you recommend, for example always asking the user to launch the app themselves before connecting?

yes. there are ongoing work toward making the experience more seamless. but for now it's the current status quo i'm afraid.

Thanks

from ledger-live.

github-actions avatar github-actions commented on August 12, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label, comment, or consider closing it.

from ledger-live.

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.