@rljson/fs-agent 0.0.28 → 0.0.29
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 +9 -4
- package/package.json +1 -1
package/dist/fs-agent.js
CHANGED
|
@@ -2198,6 +2198,13 @@ ${err.stack}` : String(err);
|
|
|
2198
2198
|
const processRef = async (treeRef, recoveryAttempt = 0, predecessorRefs, isNewestFromSender = true) => {
|
|
2199
2199
|
const maxAttempts = this._timeouts.processRefRetries + 1;
|
|
2200
2200
|
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
2201
|
+
if (!isNewestFromSender) {
|
|
2202
|
+
console.warn(
|
|
2203
|
+
`[FsAgent] ref=${treeRef.slice(0, 8)}… is not the newest its sender has advertised — ignoring it.`
|
|
2204
|
+
);
|
|
2205
|
+
connector.invalidateReceived(treeRef);
|
|
2206
|
+
return;
|
|
2207
|
+
}
|
|
2201
2208
|
this._scanner.pauseWatch();
|
|
2202
2209
|
this._remoteApplyInFlight = true;
|
|
2203
2210
|
try {
|
|
@@ -2248,12 +2255,10 @@ ${err.stack}` : String(err);
|
|
|
2248
2255
|
}
|
|
2249
2256
|
const ancestryExpected = this._resolveConflicts;
|
|
2250
2257
|
const declaresAncestry = (predecessorRefs?.length ?? 0) > 0;
|
|
2251
|
-
const
|
|
2252
|
-
const withholdPrune = ancestryExpected && !declaresAncestry || staleAdvertisement;
|
|
2253
|
-
const applyOptions = restoreOptions?.cleanTarget && withholdPrune ? { ...restoreOptions, cleanTarget: false } : restoreOptions;
|
|
2258
|
+
const applyOptions = restoreOptions?.cleanTarget && ancestryExpected && !declaresAncestry ? { ...restoreOptions, cleanTarget: false } : restoreOptions;
|
|
2254
2259
|
if (applyOptions !== restoreOptions) {
|
|
2255
2260
|
console.warn(
|
|
2256
|
-
`[FsAgent] ref=${treeRef.slice(0, 8)}…
|
|
2261
|
+
`[FsAgent] ref=${treeRef.slice(0, 8)}… declares no ancestry — applying additively, not pruning.`
|
|
2257
2262
|
);
|
|
2258
2263
|
}
|
|
2259
2264
|
await FsAgent._withTimeout(
|