[PR #6352] [MERGED] [PM-28471] Migrate individual vault to organization #32521

Closed
opened 2026-04-18 15:53:52 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/6352
Author: @aj-rosado
Created: 1/13/2026
Status: Merged
Merged: 1/16/2026
Merged by: @aj-rosado

Base: mainHead: PM-28471/migrate-individual-vault-to-organization


📝 Commits (10+)

  • 35c8688 Added SDK methods to migrate the individual vault
  • 7e5f701 Implements the vault migration process to move personal vault items to organization collections
  • 60510ad Update local data with mini response data
  • e14dcc8 Optimize migration and improve code readibility
  • f17b5e2 Improved code readibility
  • 9adea58 Merge branch 'main' into PM-28471/migrate-individual-vault-to-organization
  • 9e57bd4 Improved readibility
  • 6c4b37d Improved test coverage
  • f04468a Added MigratePersonalVaultResult
  • 73ea26e Added throwable to DialogState.Error on MigrateToMyItems

📊 Changes

24 files changed (+1267 additions, -104 deletions)

View changed files

📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/VaultSdkSource.kt (+11 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/VaultSdkSourceImpl.kt (+17 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/CipherManager.kt (+8 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/CipherManagerImpl.kt (+1 -1)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/VaultMigrationManager.kt (+13 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/VaultMigrationManagerImpl.kt (+166 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/di/VaultManagerModule.kt (+7 -0)
app/src/main/kotlin/com/x8bit/bitwarden/data/vault/repository/model/MigratePersonalVaultResult.kt (+16 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/repository/util/VaultSdkCipherExtensions.kt (+27 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/migratetomyitems/MigrateToMyItemsScreen.kt (+1 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/migratetomyitems/MigrateToMyItemsViewModel.kt (+50 -21)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/VaultSdkSourceTest.kt (+60 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/vault/manager/VaultMigrationManagerTest.kt (+560 -1)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/vault/repository/util/VaultSdkCipherExtensionsTest.kt (+51 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/migratetomyitems/MigrateToMyItemsScreenTest.kt (+2 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/migratetomyitems/MigrateToMyItemsViewModelTest.kt (+85 -17)
📝 network/src/main/kotlin/com/bitwarden/network/api/CiphersApi.kt (+1 -1)
📝 network/src/main/kotlin/com/bitwarden/network/model/BulkShareCiphersJsonRequest.kt (+2 -2)
📝 network/src/main/kotlin/com/bitwarden/network/model/CipherMiniResponseJson.kt (+50 -41)
network/src/main/kotlin/com/bitwarden/network/model/CipherWithIdJsonRequest.kt (+100 -0)

...and 4 more files

📄 Description

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-28444
https://bitwarden.atlassian.net/browse/PM-28471

📔 Objective

Implements the complete vault migration process for personal items, including SDK encryption, API synchronization, local storage updates, and performance optimizations. This change transforms the previously stub migration flow into a fully functional implementation that moves personal ciphers to organization collections using bulk operations.

Specific changes:

  • VaultMigrationManagerImpl: Implemented migratePersonalVault() to perform actual cipher migration, gets personalCiphers, migrates attachments if necessary, call new sdk method to prepare ciphers for bulkShare, calls the bulkShare API and updates the data with the response from it.

  • VaultSdkCipherExtensions: Added SyncResponseJson.Cipher.updateFromMiniResponse() extension to update cipher metadata from CipherMiniResponse

  • VaultMigrationManagerTest: Updated all 22 tests to reflect new migration behavior, including cipher persistence verification and fail-fast decryption error handling

  • VaultSdkCipherExtensionsTest: Added comprehensive tests for updateFromMiniResponse() extension covering metadata updates and collection ID preservation

  • CipherMiniResponseJsonUtil: Moved from network/src/test/ to network/src/testFixtures/ to enable cross-module test fixture reusability

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/6352 **Author:** [@aj-rosado](https://github.com/aj-rosado) **Created:** 1/13/2026 **Status:** ✅ Merged **Merged:** 1/16/2026 **Merged by:** [@aj-rosado](https://github.com/aj-rosado) **Base:** `main` ← **Head:** `PM-28471/migrate-individual-vault-to-organization` --- ### 📝 Commits (10+) - [`35c8688`](https://github.com/bitwarden/android/commit/35c86889b9d2fdf0bd259159f02e7b03398e00d7) Added SDK methods to migrate the individual vault - [`7e5f701`](https://github.com/bitwarden/android/commit/7e5f7013d097e84a0510ac25797f103dc3856db6) Implements the vault migration process to move personal vault items to organization collections - [`60510ad`](https://github.com/bitwarden/android/commit/60510ad51929b8773f87a30e49649ac86d3915fe) Update local data with mini response data - [`e14dcc8`](https://github.com/bitwarden/android/commit/e14dcc8442cefe853fc76015164b72cc332d783c) Optimize migration and improve code readibility - [`f17b5e2`](https://github.com/bitwarden/android/commit/f17b5e275314208e9d80d9f34bd7859a81c51684) Improved code readibility - [`9adea58`](https://github.com/bitwarden/android/commit/9adea58fc37d182617043f308ee2d98dd3233225) Merge branch 'main' into PM-28471/migrate-individual-vault-to-organization - [`9e57bd4`](https://github.com/bitwarden/android/commit/9e57bd4b566c6ffbe9c83b845bd1797f566f6a24) Improved readibility - [`6c4b37d`](https://github.com/bitwarden/android/commit/6c4b37d026b5a7ab177ea65cc5a1e2b23a0b4b12) Improved test coverage - [`f04468a`](https://github.com/bitwarden/android/commit/f04468a35aa5bfd558b98a72b1082b39c3ffba6e) Added MigratePersonalVaultResult - [`73ea26e`](https://github.com/bitwarden/android/commit/73ea26ee15ceecf6654adfec1d649fd1d028554a) Added throwable to DialogState.Error on MigrateToMyItems ### 📊 Changes **24 files changed** (+1267 additions, -104 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/VaultSdkSource.kt` (+11 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/VaultSdkSourceImpl.kt` (+17 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/CipherManager.kt` (+8 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/CipherManagerImpl.kt` (+1 -1) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/VaultMigrationManager.kt` (+13 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/VaultMigrationManagerImpl.kt` (+166 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/di/VaultManagerModule.kt` (+7 -0) ➕ `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/repository/model/MigratePersonalVaultResult.kt` (+16 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/repository/util/VaultSdkCipherExtensions.kt` (+27 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/migratetomyitems/MigrateToMyItemsScreen.kt` (+1 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/migratetomyitems/MigrateToMyItemsViewModel.kt` (+50 -21) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/VaultSdkSourceTest.kt` (+60 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/vault/manager/VaultMigrationManagerTest.kt` (+560 -1) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/vault/repository/util/VaultSdkCipherExtensionsTest.kt` (+51 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/migratetomyitems/MigrateToMyItemsScreenTest.kt` (+2 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/migratetomyitems/MigrateToMyItemsViewModelTest.kt` (+85 -17) 📝 `network/src/main/kotlin/com/bitwarden/network/api/CiphersApi.kt` (+1 -1) 📝 `network/src/main/kotlin/com/bitwarden/network/model/BulkShareCiphersJsonRequest.kt` (+2 -2) 📝 `network/src/main/kotlin/com/bitwarden/network/model/CipherMiniResponseJson.kt` (+50 -41) ➕ `network/src/main/kotlin/com/bitwarden/network/model/CipherWithIdJsonRequest.kt` (+100 -0) _...and 4 more files_ </details> ### 📄 Description ## 🎟️ Tracking https://bitwarden.atlassian.net/browse/PM-28444 https://bitwarden.atlassian.net/browse/PM-28471 ## 📔 Objective Implements the complete vault migration process for personal items, including SDK encryption, API synchronization, local storage updates, and performance optimizations. This change transforms the previously stub migration flow into a fully functional implementation that moves personal ciphers to organization collections using bulk operations. Specific changes: - VaultMigrationManagerImpl: Implemented migratePersonalVault() to perform actual cipher migration, gets personalCiphers, migrates attachments if necessary, call new sdk method to prepare ciphers for bulkShare, calls the bulkShare API and updates the data with the response from it. - VaultSdkCipherExtensions: Added SyncResponseJson.Cipher.updateFromMiniResponse() extension to update cipher metadata from CipherMiniResponse - VaultMigrationManagerTest: Updated all 22 tests to reflect new migration behavior, including cipher persistence verification and fail-fast decryption error handling - VaultSdkCipherExtensionsTest: Added comprehensive tests for updateFromMiniResponse() extension covering metadata updates and collection ID preservation - CipherMiniResponseJsonUtil: Moved from network/src/test/ to network/src/testFixtures/ to enable cross-module test fixture reusability ## ⏰ 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-04-18 15:53:52 -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#32521