Skip to content

Conversation

@andrebispo5
Copy link
Contributor

@andrebispo5 andrebispo5 commented Oct 20, 2025

Note

Depends on PR: #6024

🎟️ Tracking

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

📔 Objective

Unlock and PIN migration improvements:

  • The functions migratePinProtectedUserKeyIfNeeded in VaultLockManagerImpl and deriveTemporaryPinProtectedUserKeyIfNecessary in VaultRepositoryImpl now accept an initUserCryptoMethod parameter, allowing them to log and handle the unlock method used.
  • Added logging statements to record the vault unlock method and the outcome of PIN-protected user key migration or derivation, improving traceability and debugging.

Utility and code organization:

  • Introduced a new extension function InitUserCryptoMethod.methodName() in InitUserCryptoMethodExtensions.kt to provide human-readable labels for each unlock method, used in logging.

⏰ 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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 20, 2025

Logo
Checkmarx One – Scan Summary & Details1e4d39d6-5b4e-45ac-85cd-fe559ed45fc0

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

/**
* Returns the label for the given [InitUserCryptoMethod].
*/
fun InitUserCryptoMethod.methodName(): String =
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is not translated, what do you think about converting this to a property and name it logTag, or something similar, so it's clear this should only be used for logging? Would also be good to mention that in the KDocs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

makes total sense 👍

@codecov
Copy link

codecov bot commented Oct 20, 2025

Codecov Report

❌ Patch coverage is 67.85714% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.75%. Comparing base (97bb93c) to head (41a713d).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
.../repository/util/InitUserCryptoMethodExtensions.kt 22.22% 3 Missing and 4 partials ⚠️
...twarden/data/vault/manager/VaultLockManagerImpl.kt 71.42% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6052      +/-   ##
==========================================
- Coverage   84.76%   84.75%   -0.01%     
==========================================
  Files         736      737       +1     
  Lines       55340    55365      +25     
  Branches     7632     7640       +8     
==========================================
+ Hits        46909    46925      +16     
- Misses       5763     5767       +4     
- Partials     2668     2673       +5     

☔ 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.

SaintPatrck
SaintPatrck previously approved these changes Oct 20, 2025
Base automatically changed from pm-23290/migrate-pinprotecteduserkey to main October 20, 2025 17:58
@andrebispo5 andrebispo5 dismissed SaintPatrck’s stale review October 20, 2025 17:58

The base branch was changed.

# Conflicts:
#	app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/VaultLockManagerImpl.kt
#	app/src/main/kotlin/com/x8bit/bitwarden/data/vault/repository/VaultRepositoryImpl.kt
@andrebispo5 andrebispo5 marked this pull request as ready for review October 20, 2025 21:57
@andrebispo5 andrebispo5 enabled auto-merge October 20, 2025 21:59
@andrebispo5 andrebispo5 added this pull request to the merge queue Oct 20, 2025
Merged via the queue into main with commit 9f4bd70 Oct 20, 2025
9 checks passed
@andrebispo5 andrebispo5 deleted the pm-26420/pin-migration-flight-recorder branch October 20, 2025 23:00
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