@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.
- package/dist/fs-agent.js +18 -5
- 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
|
|
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=${
|
|
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
|
|
2500
|
-
|
|
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 =
|
|
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) {
|