-
Notifications
You must be signed in to change notification settings - Fork 7
Implement "Select devices" flow #16
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
Conversation
a830902 to
51ffaf6
Compare
51ffaf6 to
288908c
Compare
Have you tried wrapping the device/channel in |
|
The happy path works well here: I'm able to select a specific device! If I unplug a device while in I'll create an issue over there for that.
Is the above still true? For me, after selecting a device, the other one keeps blinking. If that's expected, let's file this as a separate issue and call this one done. |
|
Created linux-credentials/libwebauthn#103 for the panic on unplug issue |
|
(Finally applied rustfmt to all the files; merged the conflicts back into your branch.) |
Yes, this is still true. The HidDevices are now cloneable, but not the channels. Additionally, libwebauthn doesn't yet have a cancel-function. This was going to be my next work item. |
iinuwa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good; let's leave the blink cancellation to another PR. Thanks!
WIP as of now.
Looking how many devices are there on the start of an operation.
If one is there, just continue with that. If none are there, got to
UsbState::Waitingas before.If more than one are there, let each of them blink in it's own tokio-task and wait for user interaction. Once the user selects one, that operation returns with
true, and we send that over a dedicated channel.If the user does not select any device, we run into timeouts, count out how many timeouts we collected and if all starting devices are accounted for, stop the operation.
I'm not yet able to stop the blinking of all not-chosen devices, once the user has selected one, because I can't clone the hid-channel, and I can't have them in the
UsbState-enum, because they are not clone-able.