jkleinsc

#52467: fix: filter discarded devices from WebHID chooser

Merged
Created: Jul 27, 2026, 12:24:46 PM
Merged: Jul 28, 2026, 9:47:44 AM
2 comments
Target: main
  • Follow up to #52448 which included CL 7987617: hid: Recursively filter nested collections (hid: Recursively filter nested collections), HidService::FinishRequestDevice recursively strips protected reports from a selected device and drops it entirely when all of its collections are removed. The select-hid-device event only filtered devices by the HID blocklist, FIDO usage, and request filters, so it could present a device that FinishRequestDevice then discarded, causing navigator.hid.requestDevice() to resolve with an empty array.
  • This PR fixes the issues by using content::HidService::RemoveProtectedReports to filter out unusable device, so that what gets returned by the select-hid-device event consists of devices that can actually be granted.

Fixes: #52459

Assisted-by: Claude Opus 4.8

Description of Change

Checklist

Release Notes

Notes: Fixed select-hid-device presenting HID devices that could not be granted, which caused navigator.hid.requestDevice() to resolve with no device.

Backports

44-x-y
Merged
PR Number
#52497
Merged At
Jul 28, 2026, 2:12:47 PM
Released In
Not yet
Release Date
Not yet

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron