Moves UX updates to Channel#128
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the UX updates system by moving responsibility from the Device trait to the Channel trait. The main goal is to eliminate the need for Device::channel() to return a tuple and enable multiple subscribers to UX updates.
Key changes:
- Refactors Device::channel() to return only the channel instead of a (Channel, Receiver) tuple
- Switches from multi-producer single-consumer (mpsc) to broadcast channels for UX updates
- Wraps PIN entry callbacks with Arc to satisfy Clone requirements for broadcast messages
Reviewed Changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| libwebauthn/src/transport/device.rs | Updates Device trait to return only Channel from channel() method |
| libwebauthn/src/transport/channel.rs | Adds broadcast sender/receiver methods and updates UX update handling |
| libwebauthn/src/transport/hid/device.rs | Implements simplified channel() method for HID devices |
| libwebauthn/src/transport/hid/channel.rs | Updates HID channel to use broadcast for UX updates |
| libwebauthn/src/transport/cable/*.rs | Updates Cable transport implementation for broadcast UX updates |
| libwebauthn/src/transport/ble/*.rs | Updates BLE transport implementation for broadcast UX updates |
| libwebauthn/src/lib.rs | Makes UX update types Clone and wraps PIN callback with Arc |
| libwebauthn/examples/*.rs | Updates examples to use new channel API pattern |
7d2e6cf to
00f1293
Compare
00f1293 to
24fce64
Compare
Member
Author
|
Rebased. |
msirringhaus
approved these changes
Jul 21, 2025
msirringhaus
left a comment
Collaborator
There was a problem hiding this comment.
Left one small comment/question about the Arc-usage.
Otherwise looking good.
AlfioEmanueleFresta
added a commit
that referenced
this pull request
Jul 21, 2025
Requires #128. * Surfaces asynchronous transport errors via `CableUxUpdate::Error`. * All Cable errors to use `TransportError`, rather than the generic `Error`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requires #126.
Changes:
Channel, so thatDevice::channel()no longer needs to return a tuple (Channel, Channel::UxUpdate)mpsctobroadcast, allowing subscribing more than once. This allows subscribing to events without borrowing the channel mutablyArc, and makes allUxUpdatesClone, asbroadcastrequires the message to beClone