[PR #6828] [PM-32009] feat: Add infrastructure for new vault item types #43990

Open
opened 2026-04-23 22:39:51 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/6828
Author: @SaintPatrck
Created: 4/23/2026
Status: 🔄 Open

Base: mainHead: new-item-types/phase-01-04_infrastructure


📝 Commits (2)

  • 0ad22d2 PM-32009 feat: Add infrastructure for new vault item types
  • 5f659d4 Address review findings: feature flag gating, logging, save guard

📊 Changes

25 files changed (+790 additions, -4 deletions)

View changed files

📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/repository/util/VaultSdkCipherExtensions.kt (+16 -1)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/components/model/CreateVaultItemType.kt (+15 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/components/util/CreateVaultItemTypeExtensions.kt (+3 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditItemContent.kt (+7 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModel.kt (+100 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/addedit/model/CustomFieldType.kt (+3 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/addedit/util/VaultAddEditExtensions.kt (+6 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModel.kt (+3 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingViewModel.kt (+14 -2)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/vault/VaultViewModel.kt (+9 -1)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/vault/util/VaultAddItemStateExtensions.kt (+4 -0)
app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/model/VaultBankAccountType.kt (+31 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/model/VaultItemCipherType.kt (+15 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/components/util/CreateVaultItemTypeExtensionsTest.kt (+15 -0)
📝 core/src/main/kotlin/com/bitwarden/core/data/manager/model/FlagKey.kt (+10 -0)
📝 core/src/test/kotlin/com/bitwarden/core/data/manager/model/FlagKeyTest.kt (+5 -0)
📝 network/src/main/kotlin/com/bitwarden/network/model/CipherJsonRequest.kt (+9 -0)
📝 network/src/main/kotlin/com/bitwarden/network/model/CipherTypeJson.kt (+18 -0)
📝 network/src/main/kotlin/com/bitwarden/network/model/LinkedIdTypeJson.kt (+198 -0)
📝 network/src/main/kotlin/com/bitwarden/network/model/SyncResponseJson.kt (+158 -0)

...and 5 more files

📄 Description

🎟️ Tracking

PM-32009

📔 Objective

First of three stacked PRs introducing Bank Account, Driver's License, and Passport cipher types. This PR lands the foundation only — network/model plumbing, enums, feature-flag registration, and exhaustive-when branches — so the UI and vault-integration PRs can be reviewed in isolation on top of it.

The entire effort ships behind the pm-32009-new-item-types feature flag so infrastructure can merge well ahead of user-visible surface area.

Why it looks the way it does

  • SDK decryption gracefully skips unsupported types. The Bitwarden SDK does not yet expose types for these ciphers, so sync could otherwise fail open on accounts that already hold server-side rows with the new CipherType values. The mapping layer defensively drops unknown types instead of throwing, keeping sync resilient while SDK variants are being added.
  • Exhaustive when branches are updated across every affected ViewModel. Adding the enum values forces compile-time coverage everywhere — reviewers can trust that no call site silently falls into an else.
  • LinkedIdTypeJson entries (600–812) mirror the server's contract so linked-field resolution works the moment data arrives, without a second round-trip PR.

Stacked on: main
Followed by: new-item-types/phase-05-07_cipher-type-ui (UI screens)


🔄 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/6828 **Author:** [@SaintPatrck](https://github.com/SaintPatrck) **Created:** 4/23/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `new-item-types/phase-01-04_infrastructure` --- ### 📝 Commits (2) - [`0ad22d2`](https://github.com/bitwarden/android/commit/0ad22d2fc29c2a04d16345cf95d5534197e1e7ed) [PM-32009] feat: Add infrastructure for new vault item types - [`5f659d4`](https://github.com/bitwarden/android/commit/5f659d47f5ceb9c37c20251003993e91b61daa29) Address review findings: feature flag gating, logging, save guard ### 📊 Changes **25 files changed** (+790 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/repository/util/VaultSdkCipherExtensions.kt` (+16 -1) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/components/model/CreateVaultItemType.kt` (+15 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/components/util/CreateVaultItemTypeExtensions.kt` (+3 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditItemContent.kt` (+7 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModel.kt` (+100 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/addedit/model/CustomFieldType.kt` (+3 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/addedit/util/VaultAddEditExtensions.kt` (+6 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModel.kt` (+3 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingViewModel.kt` (+14 -2) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/vault/VaultViewModel.kt` (+9 -1) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/vault/util/VaultAddItemStateExtensions.kt` (+4 -0) ➕ `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/model/VaultBankAccountType.kt` (+31 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/model/VaultItemCipherType.kt` (+15 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/components/util/CreateVaultItemTypeExtensionsTest.kt` (+15 -0) 📝 `core/src/main/kotlin/com/bitwarden/core/data/manager/model/FlagKey.kt` (+10 -0) 📝 `core/src/test/kotlin/com/bitwarden/core/data/manager/model/FlagKeyTest.kt` (+5 -0) 📝 `network/src/main/kotlin/com/bitwarden/network/model/CipherJsonRequest.kt` (+9 -0) 📝 `network/src/main/kotlin/com/bitwarden/network/model/CipherTypeJson.kt` (+18 -0) 📝 `network/src/main/kotlin/com/bitwarden/network/model/LinkedIdTypeJson.kt` (+198 -0) 📝 `network/src/main/kotlin/com/bitwarden/network/model/SyncResponseJson.kt` (+158 -0) _...and 5 more files_ </details> ### 📄 Description ## 🎟️ Tracking [PM-32009](https://bitwarden.atlassian.net/browse/PM-32009) ## 📔 Objective First of three stacked PRs introducing Bank Account, Driver's License, and Passport cipher types. This PR lands the foundation only — network/model plumbing, enums, feature-flag registration, and exhaustive-when branches — so the UI and vault-integration PRs can be reviewed in isolation on top of it. The entire effort ships behind the `pm-32009-new-item-types` feature flag so infrastructure can merge well ahead of user-visible surface area. **Why it looks the way it does** - **SDK decryption gracefully skips unsupported types.** The Bitwarden SDK does not yet expose types for these ciphers, so sync could otherwise fail open on accounts that already hold server-side rows with the new `CipherType` values. The mapping layer defensively drops unknown types instead of throwing, keeping sync resilient while SDK variants are being added. - **Exhaustive `when` branches are updated across every affected ViewModel.** Adding the enum values forces compile-time coverage everywhere — reviewers can trust that no call site silently falls into an `else`. - **`LinkedIdTypeJson` entries (600–812) mirror the server's contract** so linked-field resolution works the moment data arrives, without a second round-trip PR. **Stacked on:** `main` **Followed by:** `new-item-types/phase-05-07_cipher-type-ui` (UI screens) [PM-32009]: https://bitwarden.atlassian.net/browse/PM-32009?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --- <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-23 22:39:51 -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#43990