[PR #6279] [MERGED] [PM-28468] Updated validation and navigation for MigrateToMyItems #54669

Closed
opened 2026-05-01 20:21:55 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/6279
Author: @aj-rosado
Created: 12/17/2025
Status: Merged
Merged: 1/8/2026
Merged by: @SaintPatrck

Base: mainHead: PM-28468/validate-and-navigate-to-vault-migration


📝 Commits (10+)

  • 65a63aa Updated validation and navigation for MigrateToMyItems
  • 2734ac4 Updated RootNavViewModel and added tests
  • 02c6dbd removed unnecessary hasPersonalVaultItems method
  • ff3693a Removed unnecessary comment
  • cc9e336 Deduplicated method on VaultSyncManagerImple
  • 66ced79 Saving org info on shouldMigratePersonalVaultFlow and passing it as parameter to MigrateToMyItems
  • 9e911aa Merge branch 'main' into PM-28468/validate-and-navigate-to-vault-migration
  • d49c1c1 fixed tests
  • d60d149 fixed VaultSyncManagerTests
  • a35d98a added test coverage for more scenarios on VaultSyncManagerTest

📊 Changes

22 files changed (+1370 additions, -123 deletions)

View changed files

app/schemas/com.x8bit.bitwarden.data.vault.datasource.disk.database.VaultDatabase/9.json (+279 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/datasource/disk/VaultDiskSource.kt (+10 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/datasource/disk/VaultDiskSourceImpl.kt (+5 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/datasource/disk/dao/CiphersDao.kt (+17 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/datasource/disk/database/VaultDatabase.kt (+1 -1)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/datasource/disk/entity/CipherEntity.kt (+14 -2)
app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/VaultMigrationManager.kt (+19 -0)
app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/VaultMigrationManagerImpl.kt (+155 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/di/VaultManagerModule.kt (+26 -0)
app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/model/VaultMigrationData.kt (+19 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/repository/VaultRepository.kt (+0 -7)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/repository/VaultRepositoryImpl.kt (+0 -5)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavScreen.kt (+17 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModel.kt (+43 -14)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/vaultunlocked/VaultUnlockedNavigation.kt (+6 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/migratetomyitems/MigrateToMyItemsViewModel.kt (+5 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/disk/VaultDiskSourceTest.kt (+27 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/disk/dao/FakeCiphersDao.kt (+5 -0)
app/src/test/kotlin/com/x8bit/bitwarden/data/vault/manager/VaultMigrationManagerTest.kt (+657 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/vault/repository/VaultRepositoryTest.kt (+0 -94)

...and 2 more files

📄 Description

🎟️ Tracking

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

📔 Objective

Implement navigation to the vault migration flow that prompts users with a Personal Ownership policy to migrate their personal vault items to an organization. The VaultMigrationManager reactively monitors vault state, sync completion, and network connectivity to determine when migration is required, displaying the prompt only when all conditions are met (policy active, feature flag enabled, personal ciphers exist, and network available).

The implementation includes an optimized database query using an indexed organizationId column to efficiently check for personal ciphers without loading full cipher JSON data, and ensures the migration prompt correctly appears or disappears as conditions change (e.g., going offline/online or after sync completes in multi-account scenarios).

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/6279 **Author:** [@aj-rosado](https://github.com/aj-rosado) **Created:** 12/17/2025 **Status:** ✅ Merged **Merged:** 1/8/2026 **Merged by:** [@SaintPatrck](https://github.com/SaintPatrck) **Base:** `main` ← **Head:** `PM-28468/validate-and-navigate-to-vault-migration` --- ### 📝 Commits (10+) - [`65a63aa`](https://github.com/bitwarden/android/commit/65a63aae4590e6b6c8f16e48ee43b2e61c11000d) Updated validation and navigation for MigrateToMyItems - [`2734ac4`](https://github.com/bitwarden/android/commit/2734ac4b3d26c77d1c8ffbf11dcebc5cf63efa9f) Updated RootNavViewModel and added tests - [`02c6dbd`](https://github.com/bitwarden/android/commit/02c6dbd9593bad7302d0f5debe8df2e8c54aae63) removed unnecessary hasPersonalVaultItems method - [`ff3693a`](https://github.com/bitwarden/android/commit/ff3693a58cc5a6a74272c950b0ee4a61779bb848) Removed unnecessary comment - [`cc9e336`](https://github.com/bitwarden/android/commit/cc9e3368119b1d3d0b07597973ac63c109bba20c) Deduplicated method on VaultSyncManagerImple - [`66ced79`](https://github.com/bitwarden/android/commit/66ced7951cbf7eba45734344928c740d42a0d6b4) Saving org info on shouldMigratePersonalVaultFlow and passing it as parameter to MigrateToMyItems - [`9e911aa`](https://github.com/bitwarden/android/commit/9e911aa903426d1c8f0381af9dadcb50a25a0875) Merge branch 'main' into PM-28468/validate-and-navigate-to-vault-migration - [`d49c1c1`](https://github.com/bitwarden/android/commit/d49c1c1784d43b4b4991a01b1c921e70e1310ec2) fixed tests - [`d60d149`](https://github.com/bitwarden/android/commit/d60d1493abca54854a09f159e796680b9151085e) fixed VaultSyncManagerTests - [`a35d98a`](https://github.com/bitwarden/android/commit/a35d98adc5898474334aaaa8bc0042e0a09c7649) added test coverage for more scenarios on VaultSyncManagerTest ### 📊 Changes **22 files changed** (+1370 additions, -123 deletions) <details> <summary>View changed files</summary> ➕ `app/schemas/com.x8bit.bitwarden.data.vault.datasource.disk.database.VaultDatabase/9.json` (+279 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/datasource/disk/VaultDiskSource.kt` (+10 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/datasource/disk/VaultDiskSourceImpl.kt` (+5 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/datasource/disk/dao/CiphersDao.kt` (+17 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/datasource/disk/database/VaultDatabase.kt` (+1 -1) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/datasource/disk/entity/CipherEntity.kt` (+14 -2) ➕ `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/VaultMigrationManager.kt` (+19 -0) ➕ `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/VaultMigrationManagerImpl.kt` (+155 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/di/VaultManagerModule.kt` (+26 -0) ➕ `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/model/VaultMigrationData.kt` (+19 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/repository/VaultRepository.kt` (+0 -7) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/repository/VaultRepositoryImpl.kt` (+0 -5) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavScreen.kt` (+17 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModel.kt` (+43 -14) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/vaultunlocked/VaultUnlockedNavigation.kt` (+6 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/migratetomyitems/MigrateToMyItemsViewModel.kt` (+5 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/disk/VaultDiskSourceTest.kt` (+27 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/disk/dao/FakeCiphersDao.kt` (+5 -0) ➕ `app/src/test/kotlin/com/x8bit/bitwarden/data/vault/manager/VaultMigrationManagerTest.kt` (+657 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/vault/repository/VaultRepositoryTest.kt` (+0 -94) _...and 2 more files_ </details> ### 📄 Description ## 🎟️ Tracking https://bitwarden.atlassian.net/browse/PM-28468 ## 📔 Objective Implement navigation to the vault migration flow that prompts users with a Personal Ownership policy to migrate their personal vault items to an organization. The `VaultMigrationManager` reactively monitors vault state, sync completion, and network connectivity to determine when migration is required, displaying the prompt only when all conditions are met (policy active, feature flag enabled, personal ciphers exist, and network available). The implementation includes an optimized database query using an indexed `organizationId` column to efficiently check for personal ciphers without loading full cipher JSON data, and ensures the migration prompt correctly appears or disappears as conditions change (e.g., going offline/online or after sync completes in multi-account scenarios). ## ⏰ 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-01 20:21:55 -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#54669