[PR #6558] [MERGED] [PM-30916] bug: Create passkey myitems #43764

Closed
opened 2026-04-23 22:26:12 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/6558
Author: @andrebispo5
Created: 2/20/2026
Status: Merged
Merged: 2/25/2026
Merged by: @andrebispo5

Base: mainHead: pm-30916/create-passkey-myitems


📝 Commits (8)

  • 6be74ef [PM-30916] Use selected collection IDs in toCipherView for new items
  • 0ab5e28 [PM-30916] Use createCipherInOrganization for passkeys with collections
  • ad51efe [PM-30916] Add tests for toCipherView collection IDs behavior
  • 9fa2c7e [PM-30916] Remove suppress form tests
  • 5870951 Merge branch 'main' into pm-30916/create-passkey-myitems
  • 5b6eb86 [PM-30916] Update test assertion
  • faf5c8f [PM-30916] Update Fido2CredentialStore to handle result from create and update cipher
  • 15664f6 [PM-30916] Small refactor

📊 Changes

3 files changed (+200 additions, -5 deletions)

View changed files

📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/model/Fido2CredentialStoreImpl.kt (+37 -4)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/vault/util/VaultAddItemStateExtensions.kt (+6 -1)
📝 app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/vault/util/VaultAddItemStateExtensionsTest.kt (+157 -0)

📄 Description

🎟️ Tracking

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

📔 Objective

Fixes a bug where users belonging to an organization with the PERSONAL_OWNERSHIP policy enabled could not create Passkeys into the MyItems (DEFAULT_USER_COLLECTION) collection.

Root Cause

Two issues were identified:

  1. toCipherView() in VaultAddItemStateExtensions.kt used originalCipher?.collectionIds.orEmpty() which returns an empty list for new items, ignoring the selected collection IDs from the UI state.
  2. saveCredential() in Fido2CredentialStoreImpl.kt always called createCipher() for new passkeys, which doesn't support organization collections. When PERSONAL_OWNERSHIP is enabled, ciphers must be created using
    createCipherInOrganization() with the appropriate collection IDs.

Changes

  • Updated toCipherView() to use selected collection IDs from the UI state when creating new items
  • Updated saveCredential() to use createCipherInOrganization() when the cipher belongs to an organization and has collection IDs

🔄 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/6558 **Author:** [@andrebispo5](https://github.com/andrebispo5) **Created:** 2/20/2026 **Status:** ✅ Merged **Merged:** 2/25/2026 **Merged by:** [@andrebispo5](https://github.com/andrebispo5) **Base:** `main` ← **Head:** `pm-30916/create-passkey-myitems` --- ### 📝 Commits (8) - [`6be74ef`](https://github.com/bitwarden/android/commit/6be74efa58fea3b427aeee958593fbfd50fc77d1) [PM-30916] Use selected collection IDs in toCipherView for new items - [`0ab5e28`](https://github.com/bitwarden/android/commit/0ab5e281771af554cc83ec4a2d397e81f00c0641) [PM-30916] Use createCipherInOrganization for passkeys with collections - [`ad51efe`](https://github.com/bitwarden/android/commit/ad51efe855bdb3c081c9048880fb99c448100c83) [PM-30916] Add tests for toCipherView collection IDs behavior - [`9fa2c7e`](https://github.com/bitwarden/android/commit/9fa2c7e6db6e9e6a22e7f6faa444f1e7a7326084) [PM-30916] Remove suppress form tests - [`5870951`](https://github.com/bitwarden/android/commit/58709518e002ff08195f7c8f468cb89f08d1b816) Merge branch 'main' into pm-30916/create-passkey-myitems - [`5b6eb86`](https://github.com/bitwarden/android/commit/5b6eb8692d9a10ad730a21fae598b8c57bf58750) [PM-30916] Update test assertion - [`faf5c8f`](https://github.com/bitwarden/android/commit/faf5c8fffa2ab6deac5df5cbf099acc71e5478f1) [PM-30916] Update Fido2CredentialStore to handle result from create and update cipher - [`15664f6`](https://github.com/bitwarden/android/commit/15664f63081f8654f1430b0ccbce84b40f196436) [PM-30916] Small refactor ### 📊 Changes **3 files changed** (+200 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/model/Fido2CredentialStoreImpl.kt` (+37 -4) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/vault/util/VaultAddItemStateExtensions.kt` (+6 -1) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/vault/util/VaultAddItemStateExtensionsTest.kt` (+157 -0) </details> ### 📄 Description ## 🎟️ Tracking <!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. --> https://bitwarden.atlassian.net/browse/PM-30916 ## 📔 Objective <!-- Describe what the purpose of this PR is, for example what bug you're fixing or new feature you're adding. --> Fixes a bug where users belonging to an organization with the PERSONAL_OWNERSHIP policy enabled could not create Passkeys into the MyItems (DEFAULT_USER_COLLECTION) collection. **Root Cause** Two issues were identified: 1. toCipherView() in VaultAddItemStateExtensions.kt used originalCipher?.collectionIds.orEmpty() which returns an empty list for new items, ignoring the selected collection IDs from the UI state. 2. saveCredential() in Fido2CredentialStoreImpl.kt always called createCipher() for new passkeys, which doesn't support organization collections. When PERSONAL_OWNERSHIP is enabled, ciphers must be created using createCipherInOrganization() with the appropriate collection IDs. **Changes** - Updated toCipherView() to use selected collection IDs from the UI state when creating new items - Updated saveCredential() to use createCipherInOrganization() when the cipher belongs to an organization and has collection IDs --- <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:26:12 -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#43764