Implement "Select devices" flow#16
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.
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.