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

Closed
opened 2025-11-26 23:35:55 -06:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/bitwarden/android/pull/2594

State: closed
Merged: Yes


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
**Original Pull Request:** https://github.com/bitwarden/android/pull/2594 **State:** closed **Merged:** Yes --- ## 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
GiteaMirror added the pull-request label 2025-11-26 23:35:55 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#3668