[PR #3121] [PM-6798] Fix account switch on iOS Autofill extension #4035

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

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

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

Fix account switch on iOS Autofill extension

Code changes

  • Fido2AuthenticatorService: Added a do...while for the first part of the flows so if the account is changed an exception is raised and the flow starts over. This was the fastest thing I could come up with to fix this situation.
  • CredentialProviderViewController: Subscribed to account switched completed to reset and set the AccountSwitchedException on the TaskCompletionSources necessary for passkeys. Also improved the code and refactored a bit to be able to reuse some of it in another place.
  • CredentialProviderViewController.Passkeys: Changed how we ensure vault is unlocked to consider more account states and reuse the navigation on the CredentialProviderViewController
  • Ohers: Some fixes to use Try... way for setting state on TaskCompletionSource

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/3121 **State:** closed **Merged:** Yes --- ## Type of change - [X] Bug fix - [ ] 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--> Fix account switch on iOS Autofill extension ## 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--> * **Fido2AuthenticatorService:** Added a do...while for the first part of the flows so if the account is changed an exception is raised and the flow starts over. This was the fastest thing I could come up with to fix this situation. * **CredentialProviderViewController:** Subscribed to account switched completed to reset and set the `AccountSwitchedException` on the TaskCompletionSources necessary for passkeys. Also improved the code and refactored a bit to be able to reuse some of it in another place. * **CredentialProviderViewController.Passkeys:** Changed how we ensure vault is unlocked to consider more account states and reuse the navigation on the `CredentialProviderViewController` * **Ohers:** Some fixes to use `Try...` way for setting state on `TaskCompletionSource` ## 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:39:52 -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#4035