Skip to content

Commit e865366

Browse files
authored
recovery fix for #232516 (#233293)
1 parent 7d80f16 commit e865366

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import { ISecretStorageService } from '../../../../platform/secrets/common/secre
4242
import { IFileService } from '../../../../platform/files/common/files.js';
4343
import { escapeRegExpCharacters } from '../../../../base/common/strings.js';
4444
import { IUserDataSyncMachinesService } from '../../../../platform/userDataSync/common/userDataSyncMachines.js';
45+
import { equals } from '../../../../base/common/arrays.js';
4546

4647
type AccountQuickPickItem = { label: string; authenticationProvider: IAuthenticationProvider; account?: UserDataSyncAccount; description?: string };
4748

@@ -142,8 +143,12 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
142143
}
143144
}
144145

145-
private updateAuthenticationProviders(): void {
146+
private updateAuthenticationProviders(): boolean {
147+
this.logService.info('Settings Sync: Updating authentication providers. Authentication Providers from store:', this.userDataSyncStoreManagementService.userDataSyncStore?.authenticationProviders || [].map(({ id }) => id));
148+
const oldValue = this._authenticationProviders;
146149
this._authenticationProviders = (this.userDataSyncStoreManagementService.userDataSyncStore?.authenticationProviders || []).filter(({ id }) => this.authenticationService.declaredProviders.some(provider => provider.id === id));
150+
this.logService.info('Settings Sync: Authentication providers updated', this._authenticationProviders.map(({ id }) => id));
151+
return equals(oldValue, this._authenticationProviders, (a, b) => a.id === b.id);
147152
}
148153

149154
private isSupportedAuthenticationProviderId(authenticationProviderId: string): boolean {
@@ -183,7 +188,11 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
183188

184189
await this.update();
185190

186-
this._register(this.authenticationService.onDidChangeDeclaredProviders(() => this.updateAuthenticationProviders()));
191+
this._register(this.authenticationService.onDidChangeDeclaredProviders(() => {
192+
if (this.updateAuthenticationProviders()) {
193+
this.update('declared authentication providers changed');
194+
}
195+
}));
187196

188197
this._register(Event.filter(
189198
Event.any(

0 commit comments

Comments
 (0)