[PR #2724] [PM-3222] Migration of data from LiteDB to shared pref storage #3772

Closed
opened 2025-11-26 23:37:04 -06:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/bitwarden/android/pull/2724

State: closed
Merged: Yes


Type of change

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

Objective

This change performs data migration out of LiteDB and into shared preferences. It also changes the mobile storage service to default to saving anything new to shared pref storage, and requires specifying keys for LiteDB storage.

Code changes

  • StateMigrationService: Added a 5to6 migration block for global and account-specific state values
  • MobileStorageService.cs: Added a set of LiteDB storage keys to check against when accessing storage. Also added an inline litedb-to-pref migration on the getter to cover for values that can't be handled cleanly via StateMigration (accountBiometricIntegrityValid_{userId}_{systemBioIntegrityState}) and as a catch-all to prevent anything sneaking into liteDB during the transition.
  • BaseContentPage.cs: Prevent saving last active time without a userId to prevent the orphaned value from re-appearing in storage
  • Constants.cs: Adjusted key names and removed NeverDomainsKey
  • AppIdService: Removed anonymousAppId getter since appId is already anonymous
  • CipherService: Name changes to sync with Constants and removal of SaveNeverDomainAsync method
  • StateService: Name changes to sync with Constants and removal of NeverDomains getter/setter

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team
**Original Pull Request:** https://github.com/bitwarden/android/pull/2724 **State:** closed **Merged:** Yes --- ## Type of change - [ ] 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--> This change performs data migration out of LiteDB and into shared preferences. It also changes the mobile storage service to default to saving anything new to shared pref storage, and requires specifying keys for LiteDB storage. ## 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--> * **StateMigrationService:** Added a 5to6 migration block for global and account-specific state values * **MobileStorageService.cs:** Added a set of LiteDB storage keys to check against when accessing storage. Also added an inline litedb-to-pref migration on the getter to cover for values that can't be handled cleanly via StateMigration (`accountBiometricIntegrityValid_{userId}_{systemBioIntegrityState}`) and as a catch-all to prevent anything sneaking into liteDB during the transition. * **BaseContentPage.cs:** Prevent saving last active time without a userId to prevent the orphaned value from re-appearing in storage * **Constants.cs:** Adjusted key names and removed `NeverDomainsKey` * **AppIdService:** Removed `anonymousAppId` getter since `appId` is already anonymous * **CipherService:** Name changes to sync with `Constants` and removal of `SaveNeverDomainAsync` method * **StateService:** Name changes to sync with `Constants` and removal of `NeverDomains` getter/setter ## Before you submit - Please check for formatting errors (`dotnet format --verify-no-changes`) (required) - Please add **unit tests** where it makes sense to do so (encouraged but not required) - If this change requires a **documentation update** - notify the documentation team - If this change has particular **deployment requirements** - notify the DevOps team
GiteaMirror added the pull-request label 2025-11-26 23:37:04 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#3772