Skip to content

Commit

Permalink
fetch last sync state when sync failed with 412
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 committed May 4, 2020
1 parent b3882f0 commit 2d48df5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/vs/platform/userDataSync/common/abstractSynchronizer.ts
Expand Up @@ -167,10 +167,16 @@ export abstract class AbstractSynchroniser extends Disposable {
if (e instanceof UserDataSyncError) {
switch (e.code) {
case UserDataSyncErrorCode.RemotePreconditionFailed:
// Rejected as there is a new remote version. Syncing again,
// Rejected as there is a new remote version. Syncing again...
this.logService.info(`${this.syncResourceLogLabel}: Failed to synchronize as there is a new remote version available. Synchronizing again...`);

// Avoid cache and get latest remote user data - https://github.com/microsoft/vscode/issues/90624
remoteUserData = await this.getRemoteUserData(null);

// Get the latest last sync user data. Because multiples parallel syncs (in Web) could share same last sync data
// and one of them successfully updated remote and last sync state.
lastSyncUserData = await this.getLastSyncUserData();

return this.doSync(remoteUserData, lastSyncUserData);
}
}
Expand Down

0 comments on commit 2d48df5

Please sign in to comment.