@rljson/fs-agent 0.0.47 → 0.0.48

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.
Files changed (2) hide show
  1. package/dist/fs-agent.js +18 -5
  2. package/package.json +1 -1
package/dist/fs-agent.js CHANGED
@@ -2431,10 +2431,10 @@ ${err.stack}` : String(err);
2431
2431
  `syncFromDb → extract(${this._rootPath})`
2432
2432
  );
2433
2433
  if (this._treesHaveEquivalentContent(currentTree, incomingTree)) {
2434
- const incomingFiles = this._getFileContentMap(incomingTree);
2434
+ const incomingFiles2 = this._getFileContentMap(incomingTree);
2435
2435
  const currentFiles = this._getFileContentMap(currentTree);
2436
2436
  console.log(
2437
- `[FsAgent] syncFromDb: equivalent content, skipping restore (incoming=${incomingFiles.size} entries, current=${currentFiles.size} entries, ref=${treeRef.slice(0, 8)}…)`
2437
+ `[FsAgent] syncFromDb: equivalent content, skipping restore (incoming=${incomingFiles2.size} entries, current=${currentFiles.size} entries, ref=${treeRef.slice(0, 8)}…)`
2438
2438
  );
2439
2439
  this._adoptAppliedRef(connector, treeRef);
2440
2440
  this._currentRef = treeRef;
@@ -2496,10 +2496,23 @@ ${err.stack}` : String(err);
2496
2496
  this._adoptAppliedRef(connector, treeRef);
2497
2497
  this._currentRef = postRestoreRef;
2498
2498
  this._persistCurrentRef(postRestoreRef);
2499
- const postRestoreKey = this._contentKeyFromTree(postRestoreTree);
2500
- if (postRestoreKey === this._contentKeyFromTree(incomingTree)) {
2499
+ const postRestoreFiles = this._getFileContentMap(postRestoreTree);
2500
+ const incomingFiles = this._getFileContentMap(incomingTree);
2501
+ let hasNewsOfOurOwn = false;
2502
+ for (const path of postRestoreFiles.keys()) {
2503
+ if (!incomingFiles.has(path)) {
2504
+ hasNewsOfOurOwn = true;
2505
+ break;
2506
+ }
2507
+ }
2508
+ if (!hasNewsOfOurOwn) {
2501
2509
  this._lastSentRef = postRestoreRef;
2502
- this._lastSentContentKey = postRestoreKey;
2510
+ this._lastSentContentKey = this._contentKeyFromTree(postRestoreTree);
2511
+ if (postRestoreFiles.size < incomingFiles.size) {
2512
+ console.log(
2513
+ `[FsAgent] ref=${treeRef.slice(0, 8)}… left this node behind (${postRestoreFiles.size} of ${incomingFiles.size} files) — not announcing a state that is catching up.`
2514
+ );
2515
+ }
2503
2516
  }
2504
2517
  return;
2505
2518
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rljson/fs-agent",
3
- "version": "0.0.47",
3
+ "version": "0.0.48",
4
4
  "description": "Rljson fs-agent description",
5
5
  "homepage": "https://github.com/rljson/fs-agent",
6
6
  "bugs": "https://github.com/rljson/fs-agent/issues",