Skip to content
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

Error after inactivity #66

Open
refi93 opened this issue Dec 27, 2021 · 3 comments
Open

Error after inactivity #66

refi93 opened this issue Dec 27, 2021 · 3 comments

Comments

@refi93
Copy link

refi93 commented Dec 27, 2021

Hi, some of our users (https://adalite.io) are reporting getting the following error after some time of inactivity in the app originating from this library:

Error: runtime error: cannot block in JavaScript callback, fix by wrapping code in goroutine
  at $callDeferred(./app/node_modules/bitbox02-api/lib/bitbox02-api-go.js:4:22730)
  at $panic(./app/node_modules/bitbox02-api/lib/bitbox02-api-go.js:4:23334)
  at AR(./app/node_modules/bitbox02-api/lib/bitbox02-api-go.js:8:6488)
  at $block(./app/node_modules/bitbox02-api/lib/bitbox02-api-go.js:4:24776)
  at $send(./app/node_modules/bitbox02-api/lib/bitbox02-api-go.js:4:25163)
  at Object.push.5824.$packages.bitbox02-api-js.AL.ptr.OnRead(./app/node_modules/bitbox02-api/lib/bitbox02-api-go.js:90:39864)
  at Object.e.$externalizeWrapper.e.$externalizeWrapper(./app/node_modules/bitbox02-api/lib/bitbox02-api-go.js:4:29372)
  at ? (./app/node_modules/bitbox02-api/lib/bitbox02-api-go.js:6:4331)
  at Object.e.$externalizeWrapper.e.$externalizeWrapper [as OnRead](./app/node_modules/bitbox02-api/lib/bitbox02-api-go.js:4:29372)
  at onMessage(./app/node_modules/bitbox02-api/lib/bitbox02.js:391:1)
  at HIDDevice.onInputReport(./app/node_modules/bitbox02-api/lib/bitbox02.js:310:1)

Do you know what can be causing it and how to prevent that from happening? Is that possibly something that needs to be addressed in the library itself?

@benma
Copy link
Contributor

benma commented Dec 27, 2021

Hi.
Just to clarify, this is from users while they use a BitBox02?

@refi93
Copy link
Author

refi93 commented Dec 27, 2021

I'm not completely sure as I haven't reproduced it myself and the users didn't leave a way to contact them back but given that we load the library only if the user logs in with their Bitbox02 wallet, I'd suppose so

@refi93
Copy link
Author

refi93 commented Dec 27, 2021

Ok, I checked the logs sent alongside the error and from them, it's clear that the user was connected with their Bitbox02 wallet (logged in console the firmware version etc.) .

I also found a way to replicate the issue - it happens when I'm logged with Bitbox02 wallet in one window (via WebHID, so e.g. Google Chrome) and then I try to login in a new tab with the same device. The first window then shows the error reported above. I guess the library shouldn't allow creating a new session while there's an active connection in another window (that's e.g. what Ledger does), or can you suggest a different way to handle it properly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants