[PR #1792] [MERGED] Fix for invalid PIN lock state when switching accounts #82968

Closed
opened 2026-05-22 16:13:58 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/1792
Author: @mpbw2
Created: 2/20/2022
Status: Merged
Merged: 2/22/2022
Merged by: @mpbw2

Base: accountswitchingHead: accountswitching-pinlockfix


📝 Commits (2)

  • 83ff96c fix for pin lock flow
  • c07b940 named tuple values and updated async

📊 Changes

8 files changed (+39 additions, -40 deletions)

View changed files

📝 src/App/Pages/Accounts/LockPageViewModel.cs (+9 -7)
📝 src/App/Pages/Settings/SettingsPage/SettingsPageViewModel.cs (+1 -1)
📝 src/Core/Abstractions/IStateService.cs (+2 -2)
📝 src/Core/Models/Domain/Account.cs (+1 -2)
📝 src/Core/Services/StateMigrationService.cs (+2 -5)
📝 src/Core/Services/StateService.cs (+6 -8)
📝 src/Core/Services/VaultTimeoutService.cs (+4 -3)
📝 src/iOS.Core/Controllers/LockPasswordViewController.cs (+14 -12)

📄 Description

Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

Fixes to data handling for PIN lock flow caused by my misinterpretation of a specific "key" used for crypto purposes vs a "key" used for storage purposes.

Code changes

  • Account.cs: Moved PinProtected from AccountSettings to PinProtectedKey in AccountKeys as it represents a value held in memory only (AccountKeys is never written to state storage)
  • Everything else: Updated references to changes made in Account.cs, and added await to a calls to _stateService.GetPinProtectedKeyAsync(..) so null check actually works as expected

Testing requirements

https://app.asana.com/0/1166330464508357/1201846609152550

Before you submit

  • I have added unit tests where it makes sense to do so (encouraged but not required)
  • This change requires a documentation update (notify the documentation team)
  • This change has particular deployment requirements (notify the DevOps team)

🔄 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/1792 **Author:** [@mpbw2](https://github.com/mpbw2) **Created:** 2/20/2022 **Status:** ✅ Merged **Merged:** 2/22/2022 **Merged by:** [@mpbw2](https://github.com/mpbw2) **Base:** `accountswitching` ← **Head:** `accountswitching-pinlockfix` --- ### 📝 Commits (2) - [`83ff96c`](https://github.com/bitwarden/android/commit/83ff96cf69f84c7fc52eca04a60d878a844eade8) fix for pin lock flow - [`c07b940`](https://github.com/bitwarden/android/commit/c07b940bcb464a459abe640aa27dccbf99eeb0bd) named tuple values and updated async ### 📊 Changes **8 files changed** (+39 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `src/App/Pages/Accounts/LockPageViewModel.cs` (+9 -7) 📝 `src/App/Pages/Settings/SettingsPage/SettingsPageViewModel.cs` (+1 -1) 📝 `src/Core/Abstractions/IStateService.cs` (+2 -2) 📝 `src/Core/Models/Domain/Account.cs` (+1 -2) 📝 `src/Core/Services/StateMigrationService.cs` (+2 -5) 📝 `src/Core/Services/StateService.cs` (+6 -8) 📝 `src/Core/Services/VaultTimeoutService.cs` (+4 -3) 📝 `src/iOS.Core/Controllers/LockPasswordViewController.cs` (+14 -12) </details> ### 📄 Description ## Type of change - [X] Bug fix - [X] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective <!--Describe what the purpose of this PR is. For example: what bug you're fixing or what new feature you're adding--> Fixes to data handling for PIN lock flow caused by my misinterpretation of a specific "key" used for crypto purposes vs a "key" used for storage purposes. ## Code changes <!--Explain the changes you've made to each file or major component. This should help the reviewer understand your changes--> <!--Also refer to any related changes or PRs in other repositories--> * **Account.cs:** Moved `PinProtected` from `AccountSettings` to `PinProtectedKey` in `AccountKeys` as it represents a value held in memory only (`AccountKeys` is never written to state storage) * **Everything else:** Updated references to changes made in `Account.cs`, and added `await` to a calls to `_stateService.GetPinProtectedKeyAsync(..)` so null check actually works as expected ## Testing requirements <!--What functionality requires testing by QA? This includes testing new behavior and regression testing--> https://app.asana.com/0/1166330464508357/1201846609152550 ## Before you submit - [ ] I have added **unit tests** where it makes sense to do so (encouraged but not required) - [ ] This change requires a **documentation update** (notify the documentation team) - [ ] This change has particular **deployment requirements** (notify the DevOps team) --- <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-22 16:13:58 -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#82968