[PR #2594] [MERGED] [PM-2378] Display error toast on duplicate Passkey when moving cipher to an organization #34168

Closed
opened 2026-04-21 01:48:54 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/2594
Author: @fedemkr
Created: 6/29/2023
Status: Merged
Merged: 7/24/2023
Merged by: @fedemkr

Base: PM-1575-display-passkeysHead: PM-2378-handle-duplicate-passkey-on-moving-item-to-org


📝 Commits (4)

  • a9efeed PM-2378 Display error toast if there is a duplicate passkey when moving a cipher to an org
  • 9a3b416 Merge branch 'PM-1575-display-passkeys' into PM-2378-handle-duplicate-passkey-on-moving-item-to-org
  • 421da28 PM-3097 Fix issue when moving cipher with passkey to an org where the uniqueness should be taken into consideration on different passkeys types and also the Username (#2632)
  • a0112b3 PM-3096 Fix non-discoverable passkey to be taken into account when encrypting a cipher which was causing the passkey to be removed when moving to an org (#2637)

📊 Changes

7 files changed (+89 additions, -59 deletions)

View changed files

📝 src/App/Pages/Vault/SharePageViewModel.cs (+8 -1)
📝 src/App/Resources/AppResources.Designer.cs (+10 -0)
📝 src/App/Resources/AppResources.resx (+3 -0)
📝 src/Core/Abstractions/ICipherService.cs (+7 -1)
📝 src/Core/Models/Domain/Fido2Key.cs (+18 -41)
📝 src/Core/Models/View/Fido2KeyView.cs (+3 -2)
📝 src/Core/Services/CipherService.cs (+40 -14)

📄 Description

Type of change

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

Objective

Display error toast on duplicate passkey when moving item to an organization.

Code changes

  • SharePageViewModel: Added check of duplicate passkey error and show the toast to the user in that case
  • ICipherService: Added ShareWithServerError to return the appropriate response to the caller when sharing cipher to an org. I cannot throw an ApiException with the error inside given that AppResources is not available in the Core project. Also another way would be to create and throw a specific exception for this and handle it on the caller but I thought this was better and the caller can handle the different paths more directly.
  • CipherService: Added the validation to check whether the cipher has a FIdo2Key and if so, check if the organization already has any ciphers with the same RpId (duplicate passkey) to return an error if that's the case.

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

🔄 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/2594 **Author:** [@fedemkr](https://github.com/fedemkr) **Created:** 6/29/2023 **Status:** ✅ Merged **Merged:** 7/24/2023 **Merged by:** [@fedemkr](https://github.com/fedemkr) **Base:** `PM-1575-display-passkeys` ← **Head:** `PM-2378-handle-duplicate-passkey-on-moving-item-to-org` --- ### 📝 Commits (4) - [`a9efeed`](https://github.com/bitwarden/android/commit/a9efeed798d7bcbd3a1c28813e72bb4c577a0b39) PM-2378 Display error toast if there is a duplicate passkey when moving a cipher to an org - [`9a3b416`](https://github.com/bitwarden/android/commit/9a3b416034618530639c674953d385f88bfb4f25) Merge branch 'PM-1575-display-passkeys' into PM-2378-handle-duplicate-passkey-on-moving-item-to-org - [`421da28`](https://github.com/bitwarden/android/commit/421da287d5ecdbf90fb56898dcf1ccb49f11100e) PM-3097 Fix issue when moving cipher with passkey to an org where the uniqueness should be taken into consideration on different passkeys types and also the Username (#2632) - [`a0112b3`](https://github.com/bitwarden/android/commit/a0112b3bbf12a840bec90fd889fba958372addd2) PM-3096 Fix non-discoverable passkey to be taken into account when encrypting a cipher which was causing the passkey to be removed when moving to an org (#2637) ### 📊 Changes **7 files changed** (+89 additions, -59 deletions) <details> <summary>View changed files</summary> 📝 `src/App/Pages/Vault/SharePageViewModel.cs` (+8 -1) 📝 `src/App/Resources/AppResources.Designer.cs` (+10 -0) 📝 `src/App/Resources/AppResources.resx` (+3 -0) 📝 `src/Core/Abstractions/ICipherService.cs` (+7 -1) 📝 `src/Core/Models/Domain/Fido2Key.cs` (+18 -41) 📝 `src/Core/Models/View/Fido2KeyView.cs` (+3 -2) 📝 `src/Core/Services/CipherService.cs` (+40 -14) </details> ### 📄 Description ## 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--> Display error toast on duplicate passkey when moving item to an organization. ## 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--> * **SharePageViewModel:** Added check of duplicate passkey error and show the toast to the user in that case * **ICipherService:** Added `ShareWithServerError` to return the appropriate response to the caller when sharing cipher to an org. I cannot throw an `ApiException` with the error inside given that `AppResources` is not available in the `Core` project. Also another way would be to create and throw a specific exception for this and handle it on the caller but I thought this was better and the caller can handle the different paths more directly. * **CipherService:** Added the validation to check whether the cipher has a FIdo2Key and if so, check if the organization already has any ciphers with the same `RpId` (duplicate passkey) to return an error if that's the case. ## 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 --- <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-21 01:48:54 -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#34168