@rljson/fs-agent 0.0.51 → 0.0.52

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 +5 -2
  2. package/package.json +1 -1
package/dist/fs-agent.js CHANGED
@@ -2504,10 +2504,13 @@ ${err.stack}` : String(err);
2504
2504
  }
2505
2505
  const ancestryExpected = this._resolveConflicts;
2506
2506
  const declaresAncestry = (predecessorRefs?.length ?? 0) > 0;
2507
- const applyOptions = restoreOptions?.cleanTarget && ancestryExpected && !declaresAncestry ? { ...restoreOptions, cleanTarget: false } : restoreOptions;
2507
+ const ancestryIsCarried = connector.syncConfig?.causalOrdering === true;
2508
+ const senderSawMyState = !ancestryIsCarried || this._currentRef !== void 0 && (predecessorRefs?.includes(this._currentRef) ?? false);
2509
+ const withholdPrune = restoreOptions?.cleanTarget && (ancestryExpected && !declaresAncestry || !senderSawMyState);
2510
+ const applyOptions = withholdPrune ? { ...restoreOptions, cleanTarget: false } : restoreOptions;
2508
2511
  if (applyOptions !== restoreOptions) {
2509
2512
  console.warn(
2510
- `[FsAgent] ref=${treeRef.slice(0, 8)}… declares no ancestry — applying additively, not pruning.`
2513
+ `[FsAgent] ref=${treeRef.slice(0, 8)}… ` + (declaresAncestry ? `descends from ${predecessorRefs?.map((r) => r.slice(0, 8)).join(", ")}, not from the state this node is in (${this._currentRef?.slice(0, 8) ?? "none"})` : "declares no ancestry") + ` — applying additively, not pruning.`
2511
2514
  );
2512
2515
  }
2513
2516
  if (restoreOptions?.cleanTarget) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rljson/fs-agent",
3
- "version": "0.0.51",
3
+ "version": "0.0.52",
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",