diff --git a/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts b/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts index 544d8373b92..a0e58a18477 100644 --- a/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts +++ b/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts @@ -168,9 +168,16 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat private async initialize(): Promise { const authenticationSession = await getCurrentAuthenticationSessionInfo(this.credentialsService, this.productService); - if (this.currentSessionId === undefined && this.useWorkbenchSessionId && authenticationSession?.id) { - this.currentSessionId = authenticationSession?.id; - this.useWorkbenchSessionId = !!this.environmentService.options?.settingsSyncOptions?.enabled; + if (this.currentSessionId === undefined && authenticationSession?.id) { + if (this.environmentService.options?.settingsSyncOptions?.authenticationProvider && this.environmentService.options.settingsSyncOptions.enabled) { + this.currentSessionId = authenticationSession?.id; + } + + // Backward compatibility + else if (this.useWorkbenchSessionId) { + this.currentSessionId = authenticationSession?.id; + } + this.useWorkbenchSessionId = false; } await this.update();