Skip to content

fix(hid): serialize Unifying receiver identity reads - #493

Open
4dux wants to merge 2 commits into
AprilNEA:masterfrom
4dux:fix/unifying-register-probes
Open

fix(hid): serialize Unifying receiver identity reads#493
4dux wants to merge 2 commits into
AprilNEA:masterfrom
4dux:fix/unifying-register-probes

Conversation

@4dux

@4dux 4dux commented Aug 2, 2026

Copy link
Copy Markdown

Summary

Unifying device-name requests all address receiver index 0xff, and replies are correlated by register rather than by the paired slot carried in the payload. Running these requests concurrently can cross-wire replies or leave a request waiting until the probe budget expires.

Read receiver-backed slot identities sequentially, then retain concurrency for the slower per-device HID++ feature walks.

Changes

  • openlogi-hid
    • Read Unifying slot names sequentially before starting device feature walks.
    • Keep per-device HID++ probing concurrent.
    • Preserve receiver-scoped cache keys and stable slot ordering.
  • openlogi-cli
    • Replace the stale message saying Unifying receivers are unsupported.

Testing

  • cargo fmt --all -- --check
  • cargo test -p openlogi-hid -p openlogi-cli
  • cargo clippy -p openlogi-hid -p openlogi-cli --all-targets -- -D warnings
  • 114 tests passed.
  • Hardware-tested on Windows 11 with an M720 Triathlon connected through a Unifying receiver. The receiver had additional paired slots but only the M720 was powered on.

@greptile-apps

greptile-apps Bot commented Aug 2, 2026

Copy link
Copy Markdown

Greptile Summary

This revision safely bounds and serializes Unifying receiver identity reads while preserving concurrent per-device feature probing.

  • Adds a 750 ms total budget for optional Unifying identity reads.
  • Matches name responses against both the receiver register and echoed slot sub-register.
  • Continues feature probing when identity reads time out.
  • Adds regression coverage for late responses crossing slot boundaries.
  • Updates the CLI guidance to reflect Unifying receiver support.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
crates/openlogi-hid/src/inventory/probe.rs Serializes receiver-backed name reads, bounds the identity phase, validates echoed slot sub-registers, and retains concurrent feature walks.
crates/openlogi-hid/src/inventory.rs Defines the bounded duration used for optional Unifying identity reads.
crates/openlogi-hid/src/inventory/tests.rs Adds focused coverage proving that a late response for one slot cannot satisfy the next slot’s request.
crates/openlogi-cli/src/cmd/list.rs Replaces outdated receiver-support guidance with current Bolt and Unifying support information.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Drain Unifying arrival events] --> B[Sort connections by slot]
    B --> C[Read slot names sequentially]
    C --> D{750 ms phase budget expired?}
    D -- No --> E[Retain resolved names]
    D -- Yes --> F[Skip remaining optional names]
    E --> G[Walk per-device HID++ features concurrently]
    F --> G
    G --> H[Assemble receiver inventory]
Loading

Reviews (3): Last reviewed commit: "fix(hid): bound Unifying identity reads" | Re-trigger Greptile

Comment thread crates/openlogi-hid/src/inventory/probe.rs
@4dux
4dux force-pushed the fix/unifying-register-probes branch from b33a847 to a9a0ec4 Compare August 3, 2026 07:52
@Stanley5249

Copy link
Copy Markdown
Contributor

Same failure mode on the write path: every verb re-resolves its feature with the same 0x0000 getFeature header at a fixed software id, so concurrent verbs match each other's replies. #459 serializes those. No overlap with this one, just confirming it shows up outside the identity reads.

@davidbudnick davidbudnick added type: bug Something is broken or behaves incorrectly platform: all Cross-platform issue labels Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform: all Cross-platform issue type: bug Something is broken or behaves incorrectly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants