add more logs (#232718)
This commit is contained in:
Родитель
bea51cd8de
Коммит
54d1a4d6f3
|
@ -151,11 +151,11 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
|
|||
}
|
||||
|
||||
private async waitAndInitialize(): Promise<void> {
|
||||
/* wait */
|
||||
await Promise.all([this.extensionService.whenInstalledExtensionsRegistered(), this.userDataInitializationService.whenInitializationFinished()]);
|
||||
|
||||
/* initialize */
|
||||
try {
|
||||
/* wait */
|
||||
await Promise.all([this.extensionService.whenInstalledExtensionsRegistered(), this.userDataInitializationService.whenInitializationFinished()]);
|
||||
|
||||
/* initialize */
|
||||
await this.initialize();
|
||||
} catch (error) {
|
||||
// Do not log if the current window is running extension tests
|
||||
|
@ -181,7 +181,7 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
|
|||
}
|
||||
}
|
||||
|
||||
await this.update();
|
||||
await this.update('initialize');
|
||||
|
||||
this._register(this.authenticationService.onDidChangeDeclaredProviders(() => this.updateAuthenticationProviders()));
|
||||
|
||||
|
@ -189,7 +189,7 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
|
|||
Event.any(
|
||||
this.authenticationService.onDidRegisterAuthenticationProvider,
|
||||
this.authenticationService.onDidUnregisterAuthenticationProvider,
|
||||
), info => this.isSupportedAuthenticationProviderId(info.id))(() => this.update()));
|
||||
), info => this.isSupportedAuthenticationProviderId(info.id))(() => this.update('authentication provider change')));
|
||||
|
||||
this._register(Event.filter(this.userDataSyncAccountService.onTokenFailed, isSuccessive => !isSuccessive)(() => this.update('token failure')));
|
||||
|
||||
|
@ -213,11 +213,8 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
|
|||
}));
|
||||
}
|
||||
|
||||
private async update(reason?: string): Promise<void> {
|
||||
|
||||
if (reason) {
|
||||
this.logService.info(`Settings Sync: Updating due to ${reason}`);
|
||||
}
|
||||
private async update(reason: string): Promise<void> {
|
||||
this.logService.info(`Settings Sync: Updating due to ${reason}`);
|
||||
|
||||
this.updateAuthenticationProviders();
|
||||
await this.updateCurrentAccount();
|
||||
|
@ -548,6 +545,9 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
|
|||
if (authenticationProvider) {
|
||||
await this.doSignIn(authenticationProvider);
|
||||
} else {
|
||||
if (!this.authenticationProviders.length) {
|
||||
throw new Error(localize('no authentication providers during signin', "Cannot sign in because there are no authentication providers available."));
|
||||
}
|
||||
await this.pick();
|
||||
}
|
||||
}
|
||||
|
@ -688,7 +688,7 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
|
|||
this.currentAuthenticationProviderId = accountOrAuthProvider.authenticationProviderId;
|
||||
}
|
||||
this.currentSessionId = sessionId;
|
||||
await this.update();
|
||||
await this.update('sign in');
|
||||
}
|
||||
|
||||
private async onDidAuthFailure(): Promise<void> {
|
||||
|
|
|
@ -67,6 +67,7 @@ export function getSyncAreaLabel(source: SyncResource): string {
|
|||
}
|
||||
|
||||
export const enum AccountStatus {
|
||||
Uninitialized = 'uninitialized',
|
||||
Unavailable = 'unavailable',
|
||||
Available = 'available',
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче