-
-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DEVICE_EVENT in Connect fails to trigger for certain users #4869
Comments
Hi @SebastienGllmt,
i've look up at your code and there are certain lines that bothers me and maybe they are the reason (idk)
could you pls be more specific and provide an example where it doesn't work for you? |
plus a tip for that: you can call |
also after a couple of tries with and user is asked for a passphrase multiple times :( |
It's entirely possible the trick to open the iframe just-in-time is what is causing the instability. The behavior was only introduces about a month before the hardfork and so it's possible it doesn't happen for many people and we had a spike of Trezor users after we announced Shelley support causing a few affected people to speak up about the issue. I'll try and play around with the logic, but I can't reproduce the issue myself so I don't have much hope for being able to say it's definitely fixed anytime soon. |
Looking at the merged PR in your project, this seems to be resolved. I'm going to close this issue for now. If that's not the case, please re-open this issue. If you have any other problems with trezor-connect, feel free to open new issues 🙂 |
Unfortunately the error persists. After many attempts, I managed to get a build on my machine that reliably reproduces the issue for me but strangely installing the same build on a different machine doesn't reproduce the error. This is seemingly the same as some users reporting sometimes the build works for them, sometimes it doesn't. I tried to put a logpoint here: https://github.com/trezor/connect/blob/876e55e5a884507f94d2a87b2aec6f81301ef1bf/src/js/env/browser/index.js#L77 and I got the following:
So it seems that even Trezor Connect itself doesn't see the DeviceEvent. Maybe this could somehow be linked to having multiple copies of our extension downloaded at the same time? (since we ship for a mainnet build and a "nightly" build). We had the same issue with our Ledger iframe (which is what the PR mentioned earlier fixes for Ledger) |
As @szymonlesisz mentioned in this issue,
If you want to reproduce this, you can clear |
That's fine. The problem I'm having is that the DEVICE_EVENT is sometimes not fired even if the user did allow it. You can tell from the example yesterday that clearly I allowed it because my debug logs contain the To be very precise: For all users (affected by this bug or not),
However, only for users affected by this issue, the handleMessage function doesn't receive the DeviceEvent (only receiving UI events) https://github.com/trezor/connect/blob/876e55e5a884507f94d2a87b2aec6f81301ef1bf/src/js/popup/PopupManager.js#L222 |
I'll have to dig deeper into that one. I'll re-open the issue for now. In the meantime, maybe we can figure out a workaround for this. What exactly are you trying to achieve? |
When a user exports their public key through Yoroi, we look for the DEVICE_EVENT to get the device id. We plan to use in the future to be able to group accounts that belong to the same Trezor device in our UI (we don't have this feature, but hopefully coming this year) Workarounds from people that have been affected by this are as I mentioned in the original post:
I can help debug this in any way I can, but I think the code between PopupManager.js and common.js are happening on the Trezor bridge so I don't have a way to debug into it. |
@szymonlesisz I can confirm this issue on Mac OS X Brave browser, I have solved it as @SebastienGllmt suggested by using Yes, and the Trezor was brand new... |
Our app (Yoroi) essentially does the following:
However, we've recently had reports from users saying Yoroi fails to load connect their Trezor device.
This is what the logs SHOULD look like
However, for users that run into this issue, they get
Note the two device events are missing, but ui events arrived correctly.
Expected behavior: once the user selects "allow once for this session", a DEVICE_EVENT is fired
Observed behavior: in some cases, no DEVICE_EVENT is fired
What's strange is we've had people affected report weird things like:
It's strange that it would work for some users, but not others and that the UI_EVENT gets called but not the DEVICE_EVENT. Any idea what would cause this? Worst case we will just have to call
trezor.getFeatures({})
every time somebody connects Trezor to our wallet to get it working reliably.Trezor-connect version: 8.1.10
The text was updated successfully, but these errors were encountered: