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(