#50002: fix: validate USB device selection against filtered device list
Merged
Description of Change
Previously, UsbChooserController::OnDeviceChosen looked up the chosen device_id via chooser_context_->GetDeviceInfo(), which searches all known USB devices on the system rather than the filtered list shown to the select-usb-device handler. This meant a device excluded by the renderer's filters or exclusion_filters could still be granted permission if the handler returned its GUID.
This aligns the USB chooser with the Serial and HID chooser implementations, which correctly validate against their filtered lists.
Checklist
- PR description included
-
npm testpasses - PR release notes describe the change in a way relevant to app developers, and are capitalized, punctuated, and past tense.
Release Notes
Notes: none
Backports
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