GoogleChromeLabs / chromeos_smart_card_connector

Smart Card Connector App for Chrome OS
https://chrome.google.com/webstore/detail/smart-card-connector/khpfeaanjngmcnplbdlpegiifgpfgdco
Apache License 2.0
133 stars 50 forks source link

[pcsc] Retry init on more errors, try USB reset #1164

Closed emaxx-google closed 1 month ago

emaxx-google commented 1 month ago

Change the init retry mechanism to be triggered on any reader initialization error, as opposed to only doing it on openDevice/claimInterface errors. Additionally, attempt resetting the USB device after a few unsuccessful retries.

This should fix occasional flaky errors we see in the field, when there's a temporary conflict between the in-session and the login-screen instances of Smart Card Connector, which may cause failures at various USB functions and accidentally receiving a reply for a request sent by a different extension ("Invalid frame detected").

emaxx-google commented 1 month ago

One of the tests failed - seems like a real problem with composite devices. Looking into it.

github-actions[bot] commented 1 month ago

Continuous Integration: All tests passed. C/C++ test coverage: 73.58% lines.

emaxx-google commented 1 month ago

One of the tests failed - seems like a real problem with composite devices. Looking into it.

Fixed now.

github-actions[bot] commented 1 month ago

Continuous Integration: All tests passed. C/C++ test coverage: 73.58% lines.