[PM-6296] Fix biometrics error prompt when biometrics are temporarily unavailable in browser extension
đī¸ Tracking
https://bitwarden.atlassian.net/browse/PM-6296
đ Objective
We currently only have two ways of "detecting biometric availability", one is osSupported which is static per OS on browser, and dynamically detects availability on mac. The other way is biometrics failing during unlock.
Since biometrics can become temporarily unavailable (f.e closing the lid on a mac disables touchid), we need a way to dynamically detect availability in the browser extension.
This PR extends the IPC protocol with an availability check message, and the extension checks for availability before triggering the prompt. If this is due to a manual, intentional user action, a warning dialog is shown. If this is due to automatic "touchid on extension open", then no warning is shown.
đ¸ Screenshots
https://github.com/bitwarden/clients/assets/11866552/650ce95a-8e84-4a24-b588-4d06da3c51e7
â° Reminders before review
- Contributor guidelines followed
- All formatters and local linters executed and passed
- Written new unit and / or integration tests where applicable
- Protected functional changes with optionality (feature flags)
- Used internationalization (i18n) for all UI strings
- CI builds passed
- Communicated to DevOps any deployment requirements
- Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team
đĻŽ Reviewer guidelines
- đ (
:+1:) or similar for great changes - đ (
:memo:) or âšī¸ (:information_source:) for notes or general info - â (
:question:) for questions - đ¤ (
:thinking:) or đ (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - đ¨ (
:art:) for suggestions / improvements - â (
:x:) or â ī¸ (:warning:) for more significant problems or concerns needing attention - đą (
:seedling:) or âģī¸ (:recycle:) for future improvements or indications of technical debt - â (
:pick:) for minor or nitpick changes
@MGibson1 This PR re-uses "osSupportsBiometrics". Do you feel like it would make sense to split this function into one actually returning "os supports" and one returning "is currently available", or rename this into "isBiometricUnlockAvailable", since "osSupports" suggests this is about the operating system, not about whether the device is (temporarily) unavailable?
Codecov Report
Attention: Patch coverage is 6.86275% with 95 lines in your changes missing coverage. Please review.
Project coverage is 31.85%. Comparing base (
4772943) to head (50a1611). Report is 31 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #9851 +/- ##
==========================================
- Coverage 31.90% 31.85% -0.05%
==========================================
Files 2644 2667 +23
Lines 78889 79329 +440
Branches 14793 14828 +35
==========================================
+ Hits 25169 25272 +103
- Misses 51809 52147 +338
+ Partials 1911 1910 -1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Checkmarx One â Scan Summary & Details â 8a90b3bc-3118-430a-adbc-9645ba28d434
No New Or Fixed Issues Found
Since biometricsservice was a desktop only concept, I had to create a lot of the plumbing on the platforms respectively, but all biometrics functionality are pulled out of platformService now.
Fixed merge conflicts.
re-approved, but it looks like there are some failed tests
Tests failing is unrelated to the PR and is fixed by https://github.com/bitwarden/clients/pull/10215
Set to automerge since QA needs to test on main (biometrics in dev mode requires some hacks to set up).
Re-enabling auto-merge after rc cut.