[PR #5944] [MERGED] [PM-23280] Save MasterPasswordUnlockData to local state #58926

Closed
opened 2026-05-11 03:05:47 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/5944
Author: @andrebispo5
Created: 9/26/2025
Status: Merged
Merged: 10/2/2025
Merged by: @andrebispo5

Base: mainHead: pm-23280/kdf_changes_logout


📝 Commits (5)

  • 871e2a8 [PM-23280] Add MasterPasswordUnlockData to sync and identity server responses, and save to profile.
  • f586b28 [PM-23280] Fix broken test.
  • bc094a1 [PM-23280] Fix test.
  • 91296b7 Merge branch 'main' into pm-23280/kdf_changes_logout
  • 2cf0d5a [PM-23280] Fix MasterPasswordUnlockDataJson serial name and server data inconsistency.

📊 Changes

19 files changed (+359 additions, -0 deletions)

View changed files

📝 app/src/main/kotlin/com/x8bit/bitwarden/data/auth/manager/util/TrustDeviceResponseExtensions.kt (+1 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensions.kt (+20 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/auth/datasource/disk/AuthDiskSourceTest.kt (+1 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/auth/manager/TrustedDeviceManagerTests.kt (+2 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/auth/manager/util/TrustDeviceResponseExtensionsTest.kt (+2 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryTest.kt (+3 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/auth/repository/util/GetTokenResponseExtensionsTest.kt (+1 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensionsTest.kt (+255 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/platform/manager/FirstTimeActionManagerTest.kt (+1 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/platform/repository/SettingsRepositoryTest.kt (+1 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/tools/generator/repository/GeneratorRepositoryTest.kt (+1 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/disk/VaultDiskSourceTest.kt (+1 -0)
network/src/main/kotlin/com/bitwarden/network/model/KdfJson.kt (+22 -0)
network/src/main/kotlin/com/bitwarden/network/model/MasterPasswordUnlockDataJson.kt (+25 -0)
📝 network/src/main/kotlin/com/bitwarden/network/model/SyncResponseJson.kt (+3 -0)
network/src/main/kotlin/com/bitwarden/network/model/UserDecryptionJson.kt (+13 -0)
📝 network/src/main/kotlin/com/bitwarden/network/model/UserDecryptionOptionsJson.kt (+4 -0)
📝 network/src/test/kotlin/com/bitwarden/network/service/IdentityServiceTest.kt (+1 -0)
📝 network/src/testFixtures/kotlin/com/bitwarden/network/model/SyncResponseUtil.kt (+2 -0)

📄 Description

🎟️ Tracking

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

📔 Objective

This pull request introduces support for the new masterPasswordUnlock property within the UserDecryptionOptionsJson model and ensures it is properly handled. The main changes focus on updating extension functions to correctly set this property, as well as updating test cases to reflect the new field.

  • Added handling of the masterPasswordUnlock field in the toUserStateJson, toRemovedPasswordUserStateJson, and toUserStateJsonWithPassword extension functions to ensure this property is set appropriately during user state transformations.
  • Updated the toUpdatedUserStateJson function to copy or set the masterPasswordUnlock property based on the latest sync response, ensuring user state remains consistent with backend data.

These changes ensure the codebase is ready to handle the new master password unlock data property.

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

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/5944 **Author:** [@andrebispo5](https://github.com/andrebispo5) **Created:** 9/26/2025 **Status:** ✅ Merged **Merged:** 10/2/2025 **Merged by:** [@andrebispo5](https://github.com/andrebispo5) **Base:** `main` ← **Head:** `pm-23280/kdf_changes_logout` --- ### 📝 Commits (5) - [`871e2a8`](https://github.com/bitwarden/android/commit/871e2a8150973996b449477736613e03ecaf3963) [PM-23280] Add MasterPasswordUnlockData to sync and identity server responses, and save to profile. - [`f586b28`](https://github.com/bitwarden/android/commit/f586b28e27c072feebd800fd935303521b7b60af) [PM-23280] Fix broken test. - [`bc094a1`](https://github.com/bitwarden/android/commit/bc094a1f11f043e3fa819b6a7e9b340d0439c99f) [PM-23280] Fix test. - [`91296b7`](https://github.com/bitwarden/android/commit/91296b727f08debf567e5b3c6601b82ae85618ce) Merge branch 'main' into pm-23280/kdf_changes_logout - [`2cf0d5a`](https://github.com/bitwarden/android/commit/2cf0d5ad04c8e813d8eb84c6505905604784803c) [PM-23280] Fix MasterPasswordUnlockDataJson serial name and server data inconsistency. ### 📊 Changes **19 files changed** (+359 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/auth/manager/util/TrustDeviceResponseExtensions.kt` (+1 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensions.kt` (+20 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/auth/datasource/disk/AuthDiskSourceTest.kt` (+1 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/auth/manager/TrustedDeviceManagerTests.kt` (+2 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/auth/manager/util/TrustDeviceResponseExtensionsTest.kt` (+2 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryTest.kt` (+3 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/auth/repository/util/GetTokenResponseExtensionsTest.kt` (+1 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensionsTest.kt` (+255 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/platform/manager/FirstTimeActionManagerTest.kt` (+1 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/platform/repository/SettingsRepositoryTest.kt` (+1 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/tools/generator/repository/GeneratorRepositoryTest.kt` (+1 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/disk/VaultDiskSourceTest.kt` (+1 -0) ➕ `network/src/main/kotlin/com/bitwarden/network/model/KdfJson.kt` (+22 -0) ➕ `network/src/main/kotlin/com/bitwarden/network/model/MasterPasswordUnlockDataJson.kt` (+25 -0) 📝 `network/src/main/kotlin/com/bitwarden/network/model/SyncResponseJson.kt` (+3 -0) ➕ `network/src/main/kotlin/com/bitwarden/network/model/UserDecryptionJson.kt` (+13 -0) 📝 `network/src/main/kotlin/com/bitwarden/network/model/UserDecryptionOptionsJson.kt` (+4 -0) 📝 `network/src/test/kotlin/com/bitwarden/network/service/IdentityServiceTest.kt` (+1 -0) 📝 `network/src/testFixtures/kotlin/com/bitwarden/network/model/SyncResponseUtil.kt` (+2 -0) </details> ### 📄 Description ## 🎟️ Tracking <!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. --> https://bitwarden.atlassian.net/browse/PM-23280 ## 📔 Objective <!-- Describe what the purpose of this PR is, for example what bug you're fixing or new feature you're adding. --> This pull request introduces support for the new `masterPasswordUnlock` property within the `UserDecryptionOptionsJson` model and ensures it is properly handled. The main changes focus on updating extension functions to correctly set this property, as well as updating test cases to reflect the new field. * Added handling of the `masterPasswordUnlock` field in the `toUserStateJson`, `toRemovedPasswordUserStateJson`, and `toUserStateJsonWithPassword` extension functions to ensure this property is set appropriately during user state transformations. * Updated the `toUpdatedUserStateJson` function to copy or set the `masterPasswordUnlock` property based on the latest sync response, ensuring user state remains consistent with backend data. These changes ensure the codebase is ready to handle the new master password unlock data property. ## ⏰ 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 <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-11 03:05:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#58926