Skip to content

Commit c95aa8a

Browse files
committed
Revert "Fix microsoft#145794"
This reverts commit ee0c8c4.
1 parent ee0c8c4 commit c95aa8a

File tree

7 files changed

+6
-14
lines changed

7 files changed

+6
-14
lines changed

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -705,14 +705,6 @@ export abstract class AbstractSynchroniser extends Disposable implements IUserDa
705705
return this.configurationService.getValue(USER_DATA_SYNC_CONFIGURATION_SCOPE);
706706
}
707707

708-
protected hasToUpdateLastSyncUserData(remoteUserData: IRemoteUserData, lastSyncUserData: IRemoteUserData | null): boolean {
709-
if (lastSyncUserData === null && remoteUserData.syncData === null) {
710-
// No remote data and No lasty sync date, so update is not needed
711-
return false;
712-
}
713-
return lastSyncUserData?.ref !== remoteUserData.ref;
714-
}
715-
716708
protected abstract readonly version: number;
717709
protected abstract generateSyncPreview(remoteUserData: IRemoteUserData, lastSyncUserData: IRemoteUserData | null, isRemoteDataFromCurrentMachine: boolean, userDataSyncConfiguration: IUserDataSyncConfiguration, token: CancellationToken): Promise<IResourcePreview[]>;
718710
protected abstract getMergeResult(resourcePreview: IResourcePreview, token: CancellationToken): Promise<IMergeResult>;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ export class ExtensionsSynchroniser extends AbstractSynchroniser implements IUse
265265
this.logService.info(`${this.syncResourceLogLabel}: Updated remote extensions.${remote.added.length ? ` Added: ${JSON.stringify(remote.added.map(e => e.identifier.id))}.` : ''}${remote.updated.length ? ` Updated: ${JSON.stringify(remote.updated.map(e => e.identifier.id))}.` : ''}${remote.removed.length ? ` Removed: ${JSON.stringify(remote.removed.map(e => e.identifier.id))}.` : ''}`);
266266
}
267267

268-
if (this.hasToUpdateLastSyncUserData(remoteUserData, lastSyncUserData)) {
268+
if (lastSyncUserData?.ref !== remoteUserData.ref) {
269269
// update last sync
270270
this.logService.trace(`${this.syncResourceLogLabel}: Updating last synchronized extensions...`);
271271
await this.updateLastSyncUserData(remoteUserData, { skippedExtensions });

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ export class GlobalStateSynchroniser extends AbstractSynchroniser implements IUs
229229
this.logService.info(`${this.syncResourceLogLabel}: Updated remote ui state`);
230230
}
231231

232-
if (this.hasToUpdateLastSyncUserData(remoteUserData, lastSyncUserData)) {
232+
if (lastSyncUserData?.ref !== remoteUserData.ref) {
233233
// update last sync
234234
this.logService.trace(`${this.syncResourceLogLabel}: Updating last synchronized ui state...`);
235235
await this.updateLastSyncUserData(remoteUserData);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ export class KeybindingsSynchroniser extends AbstractJsonFileSynchroniser implem
248248
await this.fileService.del(this.previewResource);
249249
} catch (e) { /* ignore */ }
250250

251-
if (this.hasToUpdateLastSyncUserData(remoteUserData, lastSyncUserData)) {
251+
if (lastSyncUserData?.ref !== remoteUserData.ref) {
252252
this.logService.trace(`${this.syncResourceLogLabel}: Updating last synchronized keybindings...`);
253253
await this.updateLastSyncUserData(remoteUserData, { platformSpecific: this.syncKeybindingsPerPlatform() });
254254
this.logService.info(`${this.syncResourceLogLabel}: Updated last synchronized keybindings`);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ export class SettingsSynchroniser extends AbstractJsonFileSynchroniser implement
243243
await this.fileService.del(this.previewResource);
244244
} catch (e) { /* ignore */ }
245245

246-
if (this.hasToUpdateLastSyncUserData(remoteUserData, lastSyncUserData)) {
246+
if (lastSyncUserData?.ref !== remoteUserData.ref) {
247247
this.logService.trace(`${this.syncResourceLogLabel}: Updating last synchronized settings...`);
248248
await this.updateLastSyncUserData(remoteUserData);
249249
this.logService.info(`${this.syncResourceLogLabel}: Updated last synchronized settings`);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export class SnippetsSynchroniser extends AbstractSynchroniser implements IUserD
149149
remoteUserData = await this.updateRemoteSnippets(accptedResourcePreviews, remoteUserData, force);
150150
}
151151

152-
if (this.hasToUpdateLastSyncUserData(remoteUserData, lastSyncUserData)) {
152+
if (lastSyncUserData?.ref !== remoteUserData.ref) {
153153
// update last sync
154154
this.logService.trace(`${this.syncResourceLogLabel}: Updating last synchronized snippets...`);
155155
await this.updateLastSyncUserData(remoteUserData);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export class TasksSynchroniser extends AbstractFileSynchroniser implements IUser
203203
await this.fileService.del(this.previewResource);
204204
} catch (e) { /* ignore */ }
205205

206-
if (this.hasToUpdateLastSyncUserData(remoteUserData, lastSyncUserData)) {
206+
if (lastSyncUserData?.ref !== remoteUserData.ref) {
207207
this.logService.trace(`${this.syncResourceLogLabel}: Updating last synchronized tasks...`);
208208
await this.updateLastSyncUserData(remoteUserData);
209209
this.logService.info(`${this.syncResourceLogLabel}: Updated last synchronized tasks`);

0 commit comments

Comments
 (0)