From 7c251675fa52dcde8116b664646e454a2fb7283e Mon Sep 17 00:00:00 2001 From: Isaiah Inuwa Date: Sun, 9 Nov 2025 00:11:02 -0600 Subject: [PATCH] Try fixing Windows MakeCredential by retaining cipher cache and explicitly syncing autofill credentials --- .../src/make_credential.rs | 9 +++++++-- .../autofill/services/desktop-autofill.service.ts | 14 +------------- .../services/fido2/fido2-authenticator.service.ts | 2 +- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/apps/desktop/desktop_native/windows_plugin_authenticator/src/make_credential.rs b/apps/desktop/desktop_native/windows_plugin_authenticator/src/make_credential.rs index db6e7ab5e34..b4b66bb1116 100644 --- a/apps/desktop/desktop_native/windows_plugin_authenticator/src/make_credential.rs +++ b/apps/desktop/desktop_native/windows_plugin_authenticator/src/make_credential.rs @@ -319,10 +319,15 @@ fn send_registration_request( tracing::debug!("Sending registration request: {}", request_json); let callback = Arc::new(TimedCallback::new()); ipc_client.prepare_passkey_registration(request, callback.clone()); - callback + let response = callback .wait_for_response(Duration::from_secs(30)) .map_err(|_| "Registration request timed out".to_string())? - .map_err(|err| err.to_string()) + .map_err(|err| err.to_string()); + if response.is_ok() { + tracing::debug!("Requesting credential sync after registering a new credential."); + ipc_client.send_native_status("request-sync".to_string(), "".to_string()); + } + response } /// Creates a CTAP make credential response from Bitwarden's WebAuthn registration response diff --git a/apps/desktop/src/autofill/services/desktop-autofill.service.ts b/apps/desktop/src/autofill/services/desktop-autofill.service.ts index 7b5a9d890f2..3b7bbf7779a 100644 --- a/apps/desktop/src/autofill/services/desktop-autofill.service.ts +++ b/apps/desktop/src/autofill/services/desktop-autofill.service.ts @@ -223,19 +223,7 @@ export class DesktopAutofillService implements OnDestroy { this.logService.error("listenPasskeyRegistration error", error); callback(error, null); } - - if (process.platform === "win32") { - // Windows does not prompt us to sync, so we need to sync immediately - // after creating the credential so it shows up in the Windows Hello - // credentials list. - try { - this.logService.info("Initiated FIDO2 sync after makeCredential") - this.adHocSync(); - } - catch (error) { - this.logService.error("Failed to sync credentials after makeCredential", error); - } - } + this.logService.info("Passkey registration completed.") }); ipc.autofill.listenPasskeyAssertionWithoutUserInterface( diff --git a/libs/common/src/platform/services/fido2/fido2-authenticator.service.ts b/libs/common/src/platform/services/fido2/fido2-authenticator.service.ts index 447e10555e5..57622e445a3 100644 --- a/libs/common/src/platform/services/fido2/fido2-authenticator.service.ts +++ b/libs/common/src/platform/services/fido2/fido2-authenticator.service.ts @@ -190,7 +190,7 @@ export class Fido2AuthenticatorService } const reencrypted = await this.cipherService.encrypt(cipher, activeUserId); await this.cipherService.updateWithServer(reencrypted); - await this.cipherService.clearCache(activeUserId); + // await this.cipherService.clearCache(activeUserId); credentialId = fido2Credential.credentialId; } catch (error) { this.logService?.error(