leafrelay 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2379,7 +2379,7 @@ var SyncEngine = class {
2379
2379
  await this.options.remote.write(normalized, merged.content);
2380
2380
  updateSyncCheckpoint(this.state, normalized, merged.content);
2381
2381
  await this.options.stateStore.save(this.state);
2382
- this.options.log(`Merged non-overlapping local and Overleaf changes in ${normalized}.`);
2382
+ this.logChange("merge", "update", normalized);
2383
2383
  return;
2384
2384
  }
2385
2385
  }
@@ -2403,6 +2403,11 @@ var SyncEngine = class {
2403
2403
  updateSyncCheckpoint(this.state, normalized, synchronized);
2404
2404
  }
2405
2405
  await this.options.stateStore.save(this.state);
2406
+ if (!localContent && remoteEntry) {
2407
+ this.logChange("push", "delete", normalized);
2408
+ } else if (localContent) {
2409
+ this.logChange("push", remoteEntry ? "update" : "add", normalized);
2410
+ }
2406
2411
  return;
2407
2412
  }
2408
2413
  if (!remoteContent) {
@@ -2415,6 +2420,14 @@ var SyncEngine = class {
2415
2420
  updateSyncCheckpoint(this.state, normalized, remoteContent);
2416
2421
  }
2417
2422
  await this.options.stateStore.save(this.state);
2423
+ if (!remoteContent && localContent) {
2424
+ this.logChange("pull", "delete", normalized);
2425
+ } else if (remoteContent) {
2426
+ this.logChange("pull", localContent ? "update" : "add", normalized);
2427
+ }
2428
+ }
2429
+ logChange(direction, operation, path) {
2430
+ this.options.log(`[${direction}] ${operation} ${JSON.stringify(path)}`);
2418
2431
  }
2419
2432
  remoteFilePaths() {
2420
2433
  return this.options.remote.listEntries().filter((entry) => isRemoteFile(entry) && !this.shouldIgnore(entry.path)).map((entry) => entry.path);
@@ -2521,4 +2534,4 @@ export {
2521
2534
  RemoteProject,
2522
2535
  startServe
2523
2536
  };
2524
- //# sourceMappingURL=chunk-PRWBFOB2.js.map
2537
+ //# sourceMappingURL=chunk-Q3R5N4YE.js.map