Skip to content

Commit 2d48df5

Browse files
committed
fetch last sync state when sync failed with 412
1 parent b3882f0 commit 2d48df5

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,16 @@ export abstract class AbstractSynchroniser extends Disposable {
167167
if (e instanceof UserDataSyncError) {
168168
switch (e.code) {
169169
case UserDataSyncErrorCode.RemotePreconditionFailed:
170-
// Rejected as there is a new remote version. Syncing again,
170+
// Rejected as there is a new remote version. Syncing again...
171171
this.logService.info(`${this.syncResourceLogLabel}: Failed to synchronize as there is a new remote version available. Synchronizing again...`);
172+
172173
// Avoid cache and get latest remote user data - https://github.com/microsoft/vscode/issues/90624
173174
remoteUserData = await this.getRemoteUserData(null);
175+
176+
// Get the latest last sync user data. Because multiples parallel syncs (in Web) could share same last sync data
177+
// and one of them successfully updated remote and last sync state.
178+
lastSyncUserData = await this.getLastSyncUserData();
179+
174180
return this.doSync(remoteUserData, lastSyncUserData);
175181
}
176182
}

0 commit comments

Comments
 (0)