From e8653663e8840adaf45af01eab5c627a5af81807 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 7 Nov 2024 12:01:40 +0100 Subject: [PATCH] recovery fix for #232516 (#233293) --- .../browser/userDataSyncWorkbenchService.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts b/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts index 1eff5f1a2e896..436ce4b3a030d 100644 --- a/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts +++ b/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts @@ -42,6 +42,7 @@ import { ISecretStorageService } from '../../../../platform/secrets/common/secre import { IFileService } from '../../../../platform/files/common/files.js'; import { escapeRegExpCharacters } from '../../../../base/common/strings.js'; import { IUserDataSyncMachinesService } from '../../../../platform/userDataSync/common/userDataSyncMachines.js'; +import { equals } from '../../../../base/common/arrays.js'; type AccountQuickPickItem = { label: string; authenticationProvider: IAuthenticationProvider; account?: UserDataSyncAccount; description?: string }; @@ -142,8 +143,12 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat } } - private updateAuthenticationProviders(): void { + private updateAuthenticationProviders(): boolean { + this.logService.info('Settings Sync: Updating authentication providers. Authentication Providers from store:', this.userDataSyncStoreManagementService.userDataSyncStore?.authenticationProviders || [].map(({ id }) => id)); + const oldValue = this._authenticationProviders; this._authenticationProviders = (this.userDataSyncStoreManagementService.userDataSyncStore?.authenticationProviders || []).filter(({ id }) => this.authenticationService.declaredProviders.some(provider => provider.id === id)); + this.logService.info('Settings Sync: Authentication providers updated', this._authenticationProviders.map(({ id }) => id)); + return equals(oldValue, this._authenticationProviders, (a, b) => a.id === b.id); } private isSupportedAuthenticationProviderId(authenticationProviderId: string): boolean { @@ -183,7 +188,11 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat await this.update(); - this._register(this.authenticationService.onDidChangeDeclaredProviders(() => this.updateAuthenticationProviders())); + this._register(this.authenticationService.onDidChangeDeclaredProviders(() => { + if (this.updateAuthenticationProviders()) { + this.update('declared authentication providers changed'); + } + })); this._register(Event.filter( Event.any(