Skip to content

Chore: Consolidate functions for setting the MasterPasswordUnlock data - #7203

Merged
david-livefront merged 1 commit into
mainfrom
update-master-password-data
Jul 23, 2026
Merged

Chore: Consolidate functions for setting the MasterPasswordUnlock data#7203
david-livefront merged 1 commit into
mainfrom
update-master-password-data

Conversation

@david-livefront

Copy link
Copy Markdown
Collaborator

🎟️ Tracking

N/A

📔 Objective

This PR consolidates the 2 functions for updating the MasterPasswordUnlockData.

@david-livefront
david-livefront requested a review from a team as a code owner July 23, 2026 15:04
@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context t:tech-debt Change Type - Tech debt labels Jul 23, 2026
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR consolidates toRemovedPasswordUserStateJson and toUserStateJsonWithPassword into a single updateMasterPasswordUnlock function that accepts an explicit userId and a nullable MasterPasswordUnlockData. All four call sites in AuthRepositoryImpl and the accompanying tests were updated, and no lingering references to the removed functions remain. The refactor is clean and the explicit userId parameter is an improvement over the previous implicit activeAccount usage.

Code Review Details
  • ❓ : Consolidated function now always clears forcePasswordResetReason, changing behavior on the password-removal path
    • app/src/main/kotlin/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensions.kt:125

@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.94%. Comparing base (04edb4c) to head (85f9ee5).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...twarden/data/auth/repository/AuthRepositoryImpl.kt 55.55% 0 Missing and 4 partials ⚠️
...ta/auth/repository/util/UserStateJsonExtensions.kt 95.23% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7203      +/-   ##
==========================================
- Coverage   86.20%   85.94%   -0.27%     
==========================================
  Files         884      930      +46     
  Lines       64672    66511    +1839     
  Branches     9673     9716      +43     
==========================================
+ Hits        55751    57162    +1411     
- Misses       5456     5870     +414     
- Partials     3465     3479      +14     
Flag Coverage Δ
app-data 17.40% <83.33%> (-0.36%) ⬇️
app-ui-auth-tools 18.64% <0.00%> (-0.14%) ⬇️
app-ui-platform 17.02% <0.00%> (+0.46%) ⬆️
app-ui-vault 27.93% <0.00%> (+0.56%) ⬆️
authenticator 6.10% <0.00%> (-0.03%) ⬇️
lib-core-network-bridge 4.01% <0.00%> (-0.01%) ⬇️
lib-data-ui 1.15% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aj-rosado aj-rosado left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@david-livefront

Copy link
Copy Markdown
Collaborator Author

Thanks @aj-rosado

@david-livefront
david-livefront added this pull request to the merge queue Jul 23, 2026
Merged via the queue into main with commit b5e9657 Jul 23, 2026
41 checks passed
@david-livefront
david-livefront deleted the update-master-password-data branch July 23, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:password-manager Bitwarden Password Manager app context t:tech-debt Change Type - Tech debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants