@rljson/fs-agent 0.0.29 → 0.0.31

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 +9 -1
  2. package/package.json +9 -19
package/dist/fs-agent.js CHANGED
@@ -1925,12 +1925,14 @@ ${err.stack}` : String(err);
1925
1925
  );
1926
1926
  this._currentRef = ref;
1927
1927
  this._persistCurrentRef(ref);
1928
- this._persistCurrentRef(ref);
1929
1928
  if (ref === this._lastSentRef) {
1930
1929
  return;
1931
1930
  }
1932
1931
  this._lastSentRef = ref;
1933
1932
  this._lastSentContentKey = contentKey;
1933
+ if (parentRef && parentRef !== ref) {
1934
+ connector.invalidateReceived(parentRef);
1935
+ }
1934
1936
  if (ref) {
1935
1937
  await this._sendRef(
1936
1938
  connector,
@@ -2198,6 +2200,12 @@ ${err.stack}` : String(err);
2198
2200
  const processRef = async (treeRef, recoveryAttempt = 0, predecessorRefs, isNewestFromSender = true) => {
2199
2201
  const maxAttempts = this._timeouts.processRefRetries + 1;
2200
2202
  for (let attempt = 1; attempt <= maxAttempts; attempt++) {
2203
+ if (treeRef === this._lastSentRef) {
2204
+ console.warn(
2205
+ `[FsAgent] ref=${treeRef.slice(0, 8)}… is this agent's own last advertisement echoed back — ignoring it.`
2206
+ );
2207
+ return;
2208
+ }
2201
2209
  if (!isNewestFromSender) {
2202
2210
  console.warn(
2203
2211
  `[FsAgent] ref=${treeRef.slice(0, 8)}… is not the newest its sender has advertised — ignoring it.`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rljson/fs-agent",
3
- "version": "0.0.29",
3
+ "version": "0.0.31",
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",
@@ -19,14 +19,6 @@
19
19
  "dist"
20
20
  ],
21
21
  "type": "module",
22
- "scripts": {
23
- "build": "pnpm exec vite build && tsc && node scripts/copy-readme-to-dist.js",
24
- "test": "cross-env NODE_OPTIONS=--max-old-space-size=8192 pnpm exec vitest run --coverage && pnpm run lint",
25
- "prebuild": "npm run test",
26
- "prepublishOnly": "npm run build",
27
- "lint": "pnpm exec eslint .",
28
- "updateGoldens": "cross-env UPDATE_GOLDENS=true pnpm test"
29
- },
30
22
  "devDependencies": {
31
23
  "@rljson/server": "^0.0.43",
32
24
  "@types/node": "^25.3.1",
@@ -59,13 +51,11 @@
59
51
  "socket.io": "^4.8.3",
60
52
  "socket.io-client": "^4.8.3"
61
53
  },
62
- "pnpm": {
63
- "onlyBuiltDependencies": [
64
- "esbuild"
65
- ],
66
- "overrides": {
67
- "@rljson/rljson": "^0.0.78"
68
- }
69
- },
70
- "packageManager": "pnpm@10.11.0"
71
- }
54
+ "scripts": {
55
+ "build": "pnpm exec vite build && tsc && node scripts/copy-readme-to-dist.js",
56
+ "test": "cross-env NODE_OPTIONS=--max-old-space-size=8192 pnpm exec vitest run --coverage && pnpm run lint",
57
+ "prebuild": "npm run test",
58
+ "lint": "pnpm exec eslint .",
59
+ "updateGoldens": "cross-env UPDATE_GOLDENS=true pnpm test"
60
+ }
61
+ }