Skip to content

Commit

Permalink
#133201 add more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 committed Nov 9, 2021
1 parent 8510f32 commit a315fd8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/vs/platform/userDataSync/common/userDataSyncAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { Emitter, Event } from 'vs/base/common/event';
import { Disposable } from 'vs/base/common/lifecycle';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { IUserDataSyncStoreService } from 'vs/platform/userDataSync/common/userDataSync';
import { IUserDataSyncLogService, IUserDataSyncStoreService } from 'vs/platform/userDataSync/common/userDataSync';

export interface IUserDataSyncAccount {
readonly authenticationProviderId: string;
Expand Down Expand Up @@ -39,10 +39,12 @@ export class UserDataSyncAccountService extends Disposable implements IUserDataS
private wasTokenFailed: boolean = false;

constructor(
@IUserDataSyncStoreService private readonly userDataSyncStoreService: IUserDataSyncStoreService
@IUserDataSyncStoreService private readonly userDataSyncStoreService: IUserDataSyncStoreService,
@IUserDataSyncLogService private readonly logService: IUserDataSyncLogService,
) {
super();
this._register(userDataSyncStoreService.onTokenFailed(() => {
this.logService.info('Settings Sync auth token failed', this.account?.authenticationProviderId, this.wasTokenFailed);
this.updateAccount(undefined);
this._onTokenFailed.fire(this.wasTokenFailed);
this.wasTokenFailed = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -657,8 +657,10 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
if (this._cachedCurrentSessionId !== cachedSessionId) {
this._cachedCurrentSessionId = cachedSessionId;
if (cachedSessionId === undefined) {
this.logService.info('Settings Sync: Reset current session');
this.storageService.remove(UserDataSyncWorkbenchService.CACHED_SESSION_STORAGE_KEY, StorageScope.GLOBAL);
} else {
this.logService.info('Settings Sync: Updated current session', cachedSessionId);
this.storageService.store(UserDataSyncWorkbenchService.CACHED_SESSION_STORAGE_KEY, cachedSessionId, StorageScope.GLOBAL, StorageTarget.MACHINE);
}
}
Expand Down

0 comments on commit a315fd8

Please sign in to comment.