Skip to content

Conversation

@andrebispo5
Copy link
Contributor

@andrebispo5 andrebispo5 commented Oct 31, 2025

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-27150

📔 Objective

This pull request improves how the Authenticator app handles biometric authentication, especially in scenarios where the device's biometric setup changes (e.g., biometrics are disabled or removed). The main focus is on ensuring that the app responds appropriately if biometrics are no longer available, both in navigation logic and in the settings UI.

Biometric Authentication Handling Improvements:

  • The app now checks if biometrics are supported before navigating to the unlock screen; if not, it triggers a new action to clear the biometric key and unlocks the app instead.
  • Added the ClearBiometricsKey action to RootNavAction.Internal, with corresponding handling in RootNavViewModel to clear the key and update navigation state.

Settings Screen Enhancements:

  • The settings screen now rechecks biometric support whenever the app resumes (comes to the foreground), disabling biometric unlock in the app if biometrics are no longer supported on the device.
  • The conditional rendering of the "Unlock with Biometrics" row is now based on a state variable that updates with lifecycle events, ensuring the UI reflects the current device biometric status.

Dependency Injection and Imports:

  • BiometricsManager is now injected into RootNavScreen using LocalBiometricsManager, and necessary imports have been added to support these changes.

📸 Screenshots

Screen.Recording.2025-10-31.at.17.15.20.mov

⏰ 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

@andrebispo5 andrebispo5 changed the title [PM-27150] React to device changes on device screen unlock method. [PM-27150] React to device changes on device screen unlock method Oct 31, 2025
@claude
Copy link
Contributor

claude bot commented Oct 31, 2025

Claude encountered an error —— View job


I'll analyze this and get back to you.

@codecov
Copy link

codecov bot commented Oct 31, 2025

Codecov Report

❌ Patch coverage is 18.75000% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.30%. Comparing base (f6be363) to head (e55b8b7).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
...or/ui/platform/feature/rootnav/RootNavViewModel.kt 0.00% 6 Missing ⚠️
...cator/ui/platform/feature/rootnav/RootNavScreen.kt 0.00% 4 Missing ⚠️
...tor/ui/platform/feature/settings/SettingsScreen.kt 50.00% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6103      +/-   ##
==========================================
- Coverage   84.81%   84.30%   -0.51%     
==========================================
  Files         721      837     +116     
  Lines       52811    55159    +2348     
  Branches     7668     7717      +49     
==========================================
+ Hits        44791    46502    +1711     
- Misses       5328     5953     +625     
- Partials     2692     2704      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Contributor

Logo
Checkmarx One – Scan Summary & Detailsd51c0a2c-4d49-47dc-8c1a-baf5fb4e05c6

Great job! No new security vulnerabilities introduced in this pull request

navController.navigateToTutorial(rootNavOptions)
}

RootNavState.NavState.Locked -> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be happening at this level. Can we move this logic into the UnlockScreen?

private fun handleClearBiometricsKey() {
settingsRepository.clearBiometricsKey()
mutableStateFlow.update {
it.copy(navState = RootNavState.NavState.Unlocked)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be needed. Just observe the isUnlockWithBiometricsEnabled state.


// Recheck biometrics support when app comes to foreground
LifecycleEventEffect { _, event ->
if (event == Lifecycle.Event.ON_RESUME) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this a composable that is called from the top level of the screen.

Additionally, can we send the state to the VM to handle this logic.

@Composable
private fun BiometricChanges(
    onBiometricSupportChange: (isSupported: Boolean) -> Unit,
) {
    LifecycleEventEffect { _, event ->
        when (event) {
            Lifecycle.Event.ON_RESUME -> {
                onBiometricSupportChange(biometricsManager.isBiometricsSupported)
            }
            else -> Unit
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants