AprilNEA / AprilNEA/OpenLogi

Bolt passkey method ignores discovered device kind when auth bit 0x01 is unset

Open
#412 1 comment 0 reactions 0 assignees View on GitHub
area: hid needs: triage type: bug
Dominant language
Rust
Stars
21k
Forks
675
Avg merge
1d 6h
Merged PRs (30d)
180

Description

## Summary

In the Bolt pairing flow, the passkey entry method shown to the user is chosen **only** from the discovery authentication byte:

```rust
// crates/openlogi-hid/src/pairing.rs — Notification::Passkey handler
let method = match pairing_auth {
Some(auth) if auth & 0x01 != 0 => PasskeyMethod::Keyboard(digits),
_ => PasskeyMethod::Pointer { clicks: passkey_to_clicks(value), passkey: digits },
};
```

If a keyboard-like device is discovered but its `pairing_auth` byte does not carry bit `0x01`, the session may still have been opened expecting keyboard entropy, yet the UI falls back to the pointer (click-sequence) method. The user is then shown click instructions for what is actually a keyboard passkey, the receiver keeps waiting for typed digits, and pairing times out.

Raised by Greptile on #381. This is **pre-existing behavior** — #381 (a refactor sweep) only tightened the passkey *digit* validation around this block; it did not introduce or change the method-selection condition, so fixing it there would be out of scope.

## Open question / needs hardware

Whether `pairing_auth & 0x01` is genuinely unreliable for keyboard-like Bolt devices, or whether the discovered `kind` should be consulted as a fallback, needs verification against real Bolt keyboards + receiver — the maintainer's hardware. If confirmed, the fix is to fold the discovered `kind` into the method decision (e.g. treat keyboard-like kinds as keyboard entry when the auth bit is ambiguous).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in crates/openlogi-hid/src/pairing.rs at the Notification::Passkey handler and trace how pairing_auth and the discovered kind are available during the Bolt pairing flow. Verify the behavior with real Bolt keyboards and a receiver, then confirm that the selected method matches the device and pairing no longer waits for the wrong input.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.