diff --git a/extensions/github-authentication/src/extension.ts b/extensions/github-authentication/src/extension.ts index 88185405ec0..a20fde2bea3 100644 --- a/extensions/github-authentication/src/extension.ts +++ b/extensions/github-authentication/src/extension.ts @@ -69,7 +69,7 @@ export function activate(context: vscode.ExtensionContext) { let before = vscode.workspace.getConfiguration().get('github-enterprise.uri'); let githubEnterpriseAuthProvider = initGHES(context, uriHandler); - context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(async e => { + context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(e => { if (e.affectsConfiguration('github-enterprise.uri')) { const after = vscode.workspace.getConfiguration().get('github-enterprise.uri'); if (before !== after) { diff --git a/src/vs/workbench/api/common/extHostAuthentication.ts b/src/vs/workbench/api/common/extHostAuthentication.ts index 887c14e64dd..5008199eb58 100644 --- a/src/vs/workbench/api/common/extHostAuthentication.ts +++ b/src/vs/workbench/api/common/extHostAuthentication.ts @@ -160,12 +160,17 @@ export class ExtHostAuthentication implements ExtHostAuthenticationShape { return Promise.resolve(); } + // Today, this only handles unregistering extensions that have disposables... + // so basiscally just the dynmaic ones. This was done to fix a bug where + // there was a racecondition between this event and re-registering a provider + // with the same id. (https://github.com/microsoft/vscode-copilot/issues/18045) + // This works for now, but should be cleaned up so theres one flow for register/unregister $onDidUnregisterAuthenticationProvider(id: string): Promise { const providerData = this._authenticationProviders.get(id); if (providerData?.disposable) { providerData.disposable.dispose(); + this._authenticationProviders.delete(id); } - this._authenticationProviders.delete(id); return Promise.resolve(); }