Skip to content

Commit 8d699df

Browse files
committed
1 parent 04545fa commit 8d699df

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

src/vs/platform/userDataSync/common/userDataAutoSyncService.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,14 @@ export class UserDataAutoSyncService extends UserDataAutoSyncEnablementService i
219219
this.telemetryService.publicLog2<{ code: string }, AutoSyncErrorClassification>(`autosync/error`, { code: userDataSyncError.code });
220220
}
221221

222-
// Turned off from another device or session got expired
223-
if (userDataSyncError.code === UserDataSyncErrorCode.TurnedOff || userDataSyncError.code === UserDataSyncErrorCode.SessionExpired) {
222+
// Session got expired
223+
if (userDataSyncError.code === UserDataSyncErrorCode.SessionExpired) {
224+
await this.turnOff(false, true /* force soft turnoff on error */);
225+
this.logService.info('Auto Sync: Turned off sync because current session is expired');
226+
}
227+
228+
// Turned off from another device
229+
if (userDataSyncError.code === UserDataSyncErrorCode.TurnedOff) {
224230
await this.turnOff(false, true /* force soft turnoff on error */);
225231
this.logService.info('Auto Sync: Turned off sync because sync is turned off in the cloud');
226232
}

src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,19 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
270270

271271
private onAutoSyncError(error: UserDataSyncError): void {
272272
switch (error.code) {
273-
case UserDataSyncErrorCode.TurnedOff:
274273
case UserDataSyncErrorCode.SessionExpired:
275274
this.notificationService.notify({
276275
severity: Severity.Info,
277-
message: localize('turned off', "Preferences sync was turned off from another device."),
276+
message: localize('session expired', "Preferences sync was turned off because current session is expired, please sign in again to turn on sync."),
277+
actions: {
278+
primary: [new Action('turn on sync', localize('turn on sync', "Turn on Preferences Sync..."), undefined, true, () => this.turnOn())]
279+
}
280+
});
281+
break;
282+
case UserDataSyncErrorCode.TurnedOff:
283+
this.notificationService.notify({
284+
severity: Severity.Info,
285+
message: localize('turned off', "Preferences sync was turned off from another device, please sign in again to turn on sync."),
278286
actions: {
279287
primary: [new Action('turn on sync', localize('turn on sync', "Turn on Preferences Sync..."), undefined, true, () => this.turnOn())]
280288
}

0 commit comments

Comments
 (0)