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
This commit is contained in:
Tyler James Leonhardt
2025-12-09 17:44:13 -08:00
committed by GitHub
parent 57f6d3a72c
commit 4daf55738a

View File

@@ -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();