mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-31 00:10:04 +08:00
Fix race condition in unregistering authentication providers (#250667)
A minimal change for endgame.
This commit is contained in:
committed by
GitHub
parent
75ea5730cc
commit
89fbfc20ab
@@ -69,7 +69,7 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
|
||||
let before = vscode.workspace.getConfiguration().get<string>('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<string>('github-enterprise.uri');
|
||||
if (before !== after) {
|
||||
|
||||
@@ -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<void> {
|
||||
const providerData = this._authenticationProviders.get(id);
|
||||
if (providerData?.disposable) {
|
||||
providerData.disposable.dispose();
|
||||
this._authenticationProviders.delete(id);
|
||||
}
|
||||
this._authenticationProviders.delete(id);
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user