From 4daf55738a7b011e6beef9daecb84540b931b900 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt <2644648+TylerLeonhardt@users.noreply.github.com> Date: Tue, 9 Dec 2025 17:44:13 -0800 Subject: [PATCH] Tactical fix for auth provider timeout (#282353) A better bigger change should be made, but this has helped in some cases, so I'm gonna add this. ref https://github.com/microsoft/vscode/issues/260061 --- .../authentication/browser/authenticationService.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/services/authentication/browser/authenticationService.ts b/src/vs/workbench/services/authentication/browser/authenticationService.ts index 3b4df87a6c3..2966703acd3 100644 --- a/src/vs/workbench/services/authentication/browser/authenticationService.ts +++ b/src/vs/workbench/services/authentication/browser/authenticationService.ts @@ -429,6 +429,8 @@ export class AuthenticationService extends Disposable implements IAuthentication const store = new DisposableStore(); try { + // TODO: Remove this timeout and figure out a better way to ensure auth providers + // are registered _during_ extension activation. const result = await raceTimeout( raceCancellation( Event.toPromise( @@ -443,13 +445,13 @@ export class AuthenticationService extends Disposable implements IAuthentication ), 5000 ); - if (!result) { - throw new Error(`Timed out waiting for authentication provider '${providerId}' to register.`); - } - provider = this._authenticationProviders.get(result.id); + provider = this._authenticationProviders.get(providerId); if (provider) { return provider; } + if (!result) { + throw new Error(`Timed out waiting for authentication provider '${providerId}' to register.`); + } throw new Error(`No authentication provider '${providerId}' is currently registered.`); } finally { store.dispose();