fix(assets): resolve assets by displayName when no PID matches (MX Master 3S over BTLE)#26
fix(assets): resolve assets by displayName when no PID matches (MX Master 3S over BTLE)#26jcbrizu wants to merge 3 commits into
Conversation
The asset registry keys the MX Master 3S as `2b043`, but over a BTLE
link the device reports model id `b034` (ext 1) via HID++ feature 0x0003.
Neither the strict `{ext}{pid}` match nor the bare-PID suffix match finds
`2b043`, so the depot never resolves — no device image, no hotspots, just
the synthetic silhouette.
Add a final resolution step that bridges the firmware codename to the
registry `displayName` (exact, case-insensitive): "MX Master 3S" still
lines up when no PID does. This generalises to other BTLE-connected
devices whose live PID is absent from the registry.
The codename is threaded through `resolve_in_index`, `AssetResolver::resolve`
and the asset sync path. Verified on hardware: the `mx_master_3s` depot now
downloads and the mouse image renders.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — adds a codename ↔ displayName last-resort tier to the asset resolver so an MX Master 3S on BTLE (and similar devices whose live PID isn't in the registry under any transport) still picks up its depot.
- Add
Index::find_by_display_name— exact, case-insensitive lookup over the registry'sdisplayName. Unit tests cover both case-insensitivity and "exact, not substring" (soMX Master 3cannot bleed into theMX Master 3Sdepot). - Thread
codenamethroughAssetResolver::resolveandresolve_in_index— match order documented in the rustdoc as force → strict PID → suffix PID → codename. New module tests demonstrate the bug (PID-only misses BTLE 3S) and the fix (codename bridges to themx_master_3sdepot). - Propagate the codename through the sync path —
sync::syncnow takes&[(DeviceModelInfo, Option<String>)],collect_modelspairsmodel_infowithpaired.codename, and the GUI render call site passespaired.codename.as_deref()tocache.resolve.
PID matching still takes precedence, the name match runs only after both PID tiers miss, and the codename comes from firmware (Bolt receiver) or a hard-coded synthetic lookup — never from user input — so the new tier doesn't widen the matching surface in a risky way. The fallback chain inside load_files (variant → side_core.png → front_core.png) already handles the case where a codename-matched depot's manifest.json doesn't have an entry for the device's reported extended_model_id, so a depot hit still renders something.
Claude Opus | 𝕏
The master merge brought in DeviceModelInfo::serial_number (added when DeviceInformation gained the optional serial-number function), but the btle_3s_model test helper still constructed the struct without it, so the merged tree failed to compile. Add the missing serial_number: None.
|
Rebased onto
Thanks @jcbrizu! Closing since the change is now on master. |

Problem
On an MX Master 3S connected through a Logi Bolt receiver, OpenLogi shows no device image — the GUI falls back to the synthetic silhouette and the asset depot is never downloaded (
sync: no matching depots for connected devices).Root cause: over BTLE the device's HID++
DeviceInformation(feature0x0003) reportsmodel_ids = [0xb034],extended_model_id = 1, i.e.config_key = "1b034". The asset registry, however, keys the MX Master 3S as2b043(a different transport's PID).resolve_in_indexonly matches by PID — strict{ext}{pid}and bare-PID suffix — and the device never reportsb043under any transport, so nothing matches.Observed with
openlogi liston hardware:Fix
Add a final resolution step that bridges the firmware codename to the registry
displayName(exact, case-insensitive)."MX Master 3S"lines up even when no PID does. This generalises to any BTLE-connected device whose live PID is absent from the registry.The codename is threaded through
resolve_in_index,AssetResolver::resolve, and the asset sync path (collect_modelsnow carries(DeviceModelInfo, Option<String>)). PID matching still takes precedence; the name match is a last resort, so existing devices are unaffected.Verification
cargo test -p openlogi-assets -p openlogi-gui— green, including new tests forIndex::find_by_display_nameand for the codename fallback inresolve_in_index(a BTLE 3S model misses by PID, resolves by codename).asset matched via codename↔displayName fallback depot="mx_master_3s", themx_master_3sdepot downloads, and the mouse image renders.Likely also helps the missing-image symptom reported in #19 / #25.