@rljson/fs-agent 0.0.54 → 0.0.56
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.d.ts +0 -18
- package/dist/fs-agent.js +3 -40
- package/package.json +1 -1
package/dist/fs-agent.d.ts
CHANGED
|
@@ -276,24 +276,6 @@ export declare class FsAgent {
|
|
|
276
276
|
/** Files written vs left alone by the current {@link restore}. */
|
|
277
277
|
private _restoreWritten;
|
|
278
278
|
private _restoreSkipped;
|
|
279
|
-
/**
|
|
280
|
-
* The file set of the newest tree any peer has told this node about.
|
|
281
|
-
*
|
|
282
|
-
* Kept so the send path can answer the one question a receiver never can:
|
|
283
|
-
* am I about to announce my progress through someone else's state?
|
|
284
|
-
*/
|
|
285
|
-
private _lastKnownRemoteFiles?;
|
|
286
|
-
/**
|
|
287
|
-
* Whether a LOCAL deletion has been seen since the last apply.
|
|
288
|
-
*
|
|
289
|
-
* The discriminator 0.0.49 lacked. A folder smaller than the newest tree
|
|
290
|
-
* this node knows about is either a node still catching up or a node someone
|
|
291
|
-
* deleted files from, and those need opposite treatment — the first must stay
|
|
292
|
-
* quiet, the second must be heard. The shapes are identical; the CAUSE is
|
|
293
|
-
* not, and only this node can see it: a deletion arrives as a watcher event,
|
|
294
|
-
* catching up does not.
|
|
295
|
-
*/
|
|
296
|
-
private _localDeleteSinceApply;
|
|
297
279
|
/**
|
|
298
280
|
* Files this restore DELETED.
|
|
299
281
|
*
|
package/dist/fs-agent.js
CHANGED
|
@@ -1152,24 +1152,6 @@ class FsAgent {
|
|
|
1152
1152
|
/** Files written vs left alone by the current {@link restore}. */
|
|
1153
1153
|
_restoreWritten = 0;
|
|
1154
1154
|
_restoreSkipped = 0;
|
|
1155
|
-
/**
|
|
1156
|
-
* The file set of the newest tree any peer has told this node about.
|
|
1157
|
-
*
|
|
1158
|
-
* Kept so the send path can answer the one question a receiver never can:
|
|
1159
|
-
* am I about to announce my progress through someone else's state?
|
|
1160
|
-
*/
|
|
1161
|
-
_lastKnownRemoteFiles;
|
|
1162
|
-
/**
|
|
1163
|
-
* Whether a LOCAL deletion has been seen since the last apply.
|
|
1164
|
-
*
|
|
1165
|
-
* The discriminator 0.0.49 lacked. A folder smaller than the newest tree
|
|
1166
|
-
* this node knows about is either a node still catching up or a node someone
|
|
1167
|
-
* deleted files from, and those need opposite treatment — the first must stay
|
|
1168
|
-
* quiet, the second must be heard. The shapes are identical; the CAUSE is
|
|
1169
|
-
* not, and only this node can see it: a deletion arrives as a watcher event,
|
|
1170
|
-
* catching up does not.
|
|
1171
|
-
*/
|
|
1172
|
-
_localDeleteSinceApply = false;
|
|
1173
1155
|
/**
|
|
1174
1156
|
* Files this restore DELETED.
|
|
1175
1157
|
*
|
|
@@ -2025,7 +2007,6 @@ ${err.stack}` : String(err);
|
|
|
2025
2007
|
debouncedSync({ type: "safety-rescan" });
|
|
2026
2008
|
};
|
|
2027
2009
|
const debouncedSync = (change) => {
|
|
2028
|
-
if (change?.type === "deleted") this._localDeleteSinceApply = true;
|
|
2029
2010
|
if (change?.type === "safety-rescan" && this._remoteApplyInFlight) {
|
|
2030
2011
|
this._rescanDeferred = true;
|
|
2031
2012
|
return;
|
|
@@ -2040,25 +2021,6 @@ ${err.stack}` : String(err);
|
|
|
2040
2021
|
if (contentKey === this._lastSentContentKey) {
|
|
2041
2022
|
return;
|
|
2042
2023
|
}
|
|
2043
|
-
const known = this._lastKnownRemoteFiles;
|
|
2044
|
-
if (known && !this._localDeleteSinceApply && tree.trees.size > 0) {
|
|
2045
|
-
const mine = this._getFileContentMap(tree);
|
|
2046
|
-
if (mine.size < known.size) {
|
|
2047
|
-
let hasOwn = false;
|
|
2048
|
-
for (const path of mine.keys()) {
|
|
2049
|
-
if (!known.has(path)) {
|
|
2050
|
-
hasOwn = true;
|
|
2051
|
-
break;
|
|
2052
|
-
}
|
|
2053
|
-
}
|
|
2054
|
-
if (!hasOwn) {
|
|
2055
|
-
console.log(
|
|
2056
|
-
`[FsAgent] not announcing ${mine.size} of ${known.size} files — nothing here was deleted locally, so this is a gap rather than news.`
|
|
2057
|
-
);
|
|
2058
|
-
return;
|
|
2059
|
-
}
|
|
2060
|
-
}
|
|
2061
|
-
}
|
|
2062
2024
|
const dbAdapter = new FsDbAdapter(db, treeKey);
|
|
2063
2025
|
const parentRef = this._currentRef;
|
|
2064
2026
|
const previous = await this._ancestryPrevious(
|
|
@@ -2087,6 +2049,9 @@ ${err.stack}` : String(err);
|
|
|
2087
2049
|
connector.invalidateReceived(parentRef);
|
|
2088
2050
|
}
|
|
2089
2051
|
if (ref) {
|
|
2052
|
+
console.log(
|
|
2053
|
+
`[FsAgent] pushing ref=${ref.slice(0, 8)}… parent=${parentRef?.slice(0, 8) ?? "none"} files=${this._getFileContentMap(tree).size}`
|
|
2054
|
+
);
|
|
2090
2055
|
await this._sendRef(
|
|
2091
2056
|
connector,
|
|
2092
2057
|
ref,
|
|
@@ -2542,8 +2507,6 @@ ${err.stack}` : String(err);
|
|
|
2542
2507
|
this._persistCurrentRef(postRestoreRef);
|
|
2543
2508
|
const postRestoreFiles = this._getFileContentMap(postRestoreTree);
|
|
2544
2509
|
const incomingFiles = this._getFileContentMap(incomingTree);
|
|
2545
|
-
this._lastKnownRemoteFiles = incomingFiles;
|
|
2546
|
-
this._localDeleteSinceApply = false;
|
|
2547
2510
|
let hasNewsOfOurOwn = false;
|
|
2548
2511
|
for (const path of postRestoreFiles.keys()) {
|
|
2549
2512
|
if (!incomingFiles.has(path)) {
|