zen-fs-config 0.10.3 → 0.10.4
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/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +14 -2
- package/dist/index.mjs +14 -2
- package/dist/zen-fs-config.js +14 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1398,6 +1398,12 @@ declare class ConfigRepo implements IConfigRepo {
|
|
|
1398
1398
|
* 见 `healEmptyBootstrapDescriptors()`。
|
|
1399
1399
|
*/
|
|
1400
1400
|
private explicitEmptyDescriptors;
|
|
1401
|
+
/**
|
|
1402
|
+
* 描述符文件路径 → 已确认在远端不存在。目录清单按 ETag 复用,删除不会
|
|
1403
|
+
* 改变 ETag,所以清单会长期保留已删除的文件名;这里记住 404 结果,
|
|
1404
|
+
* 避免每次 `listAppDataGroups()` 都为同一批死文件再发一次 GET。
|
|
1405
|
+
*/
|
|
1406
|
+
private missingDescriptorFiles;
|
|
1401
1407
|
/**
|
|
1402
1408
|
* Tracks the background initial sync started by createConfigRepo().
|
|
1403
1409
|
* `flush()` and `dispose()` will await this if it hasn't completed yet,
|
package/dist/index.d.ts
CHANGED
|
@@ -1398,6 +1398,12 @@ declare class ConfigRepo implements IConfigRepo {
|
|
|
1398
1398
|
* 见 `healEmptyBootstrapDescriptors()`。
|
|
1399
1399
|
*/
|
|
1400
1400
|
private explicitEmptyDescriptors;
|
|
1401
|
+
/**
|
|
1402
|
+
* 描述符文件路径 → 已确认在远端不存在。目录清单按 ETag 复用,删除不会
|
|
1403
|
+
* 改变 ETag,所以清单会长期保留已删除的文件名;这里记住 404 结果,
|
|
1404
|
+
* 避免每次 `listAppDataGroups()` 都为同一批死文件再发一次 GET。
|
|
1405
|
+
*/
|
|
1406
|
+
private missingDescriptorFiles;
|
|
1401
1407
|
/**
|
|
1402
1408
|
* Tracks the background initial sync started by createConfigRepo().
|
|
1403
1409
|
* `flush()` and `dispose()` will await this if it hasn't completed yet,
|
package/dist/index.js
CHANGED
|
@@ -3472,6 +3472,12 @@ var ConfigRepo = class _ConfigRepo {
|
|
|
3472
3472
|
* 见 `healEmptyBootstrapDescriptors()`。
|
|
3473
3473
|
*/
|
|
3474
3474
|
explicitEmptyDescriptors = /* @__PURE__ */ new Set();
|
|
3475
|
+
/**
|
|
3476
|
+
* 描述符文件路径 → 已确认在远端不存在。目录清单按 ETag 复用,删除不会
|
|
3477
|
+
* 改变 ETag,所以清单会长期保留已删除的文件名;这里记住 404 结果,
|
|
3478
|
+
* 避免每次 `listAppDataGroups()` 都为同一批死文件再发一次 GET。
|
|
3479
|
+
*/
|
|
3480
|
+
missingDescriptorFiles = /* @__PURE__ */ new Set();
|
|
3475
3481
|
/**
|
|
3476
3482
|
* Tracks the background initial sync started by createConfigRepo().
|
|
3477
3483
|
* `flush()` and `dispose()` will await this if it hasn't completed yet,
|
|
@@ -6516,15 +6522,21 @@ var ConfigRepo = class _ConfigRepo {
|
|
|
6516
6522
|
}
|
|
6517
6523
|
for (const entry of entries) {
|
|
6518
6524
|
if (!entry.endsWith(".json")) continue;
|
|
6525
|
+
const filePath = `${dir}/${entry}`;
|
|
6526
|
+
if (this.missingDescriptorFiles.has(filePath)) continue;
|
|
6519
6527
|
try {
|
|
6520
|
-
const raw = await this.cachedFS.readFile(
|
|
6528
|
+
const raw = await this.cachedFS.readFile(filePath);
|
|
6521
6529
|
const desc = JSON.parse(new TextDecoder().decode(toUint8Array2(raw)));
|
|
6522
6530
|
if (desc.id && desc.groupType === "data-sync" && !byId.has(desc.id)) {
|
|
6523
6531
|
const descriptor = desc;
|
|
6524
6532
|
descriptor.backends = await this.resolveAppDataGroupBackends(desc.id, descriptor);
|
|
6525
6533
|
byId.set(desc.id, descriptor);
|
|
6526
6534
|
}
|
|
6527
|
-
} catch {
|
|
6535
|
+
} catch (err) {
|
|
6536
|
+
const code = err?.code;
|
|
6537
|
+
if (code === "ENOENT" || err instanceof Error && /not\s*found/i.test(err.message)) {
|
|
6538
|
+
this.missingDescriptorFiles.add(filePath);
|
|
6539
|
+
}
|
|
6528
6540
|
}
|
|
6529
6541
|
}
|
|
6530
6542
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -2678,6 +2678,12 @@ var ConfigRepo = class _ConfigRepo {
|
|
|
2678
2678
|
* 见 `healEmptyBootstrapDescriptors()`。
|
|
2679
2679
|
*/
|
|
2680
2680
|
explicitEmptyDescriptors = /* @__PURE__ */ new Set();
|
|
2681
|
+
/**
|
|
2682
|
+
* 描述符文件路径 → 已确认在远端不存在。目录清单按 ETag 复用,删除不会
|
|
2683
|
+
* 改变 ETag,所以清单会长期保留已删除的文件名;这里记住 404 结果,
|
|
2684
|
+
* 避免每次 `listAppDataGroups()` 都为同一批死文件再发一次 GET。
|
|
2685
|
+
*/
|
|
2686
|
+
missingDescriptorFiles = /* @__PURE__ */ new Set();
|
|
2681
2687
|
/**
|
|
2682
2688
|
* Tracks the background initial sync started by createConfigRepo().
|
|
2683
2689
|
* `flush()` and `dispose()` will await this if it hasn't completed yet,
|
|
@@ -5722,15 +5728,21 @@ var ConfigRepo = class _ConfigRepo {
|
|
|
5722
5728
|
}
|
|
5723
5729
|
for (const entry of entries) {
|
|
5724
5730
|
if (!entry.endsWith(".json")) continue;
|
|
5731
|
+
const filePath = `${dir}/${entry}`;
|
|
5732
|
+
if (this.missingDescriptorFiles.has(filePath)) continue;
|
|
5725
5733
|
try {
|
|
5726
|
-
const raw = await this.cachedFS.readFile(
|
|
5734
|
+
const raw = await this.cachedFS.readFile(filePath);
|
|
5727
5735
|
const desc = JSON.parse(new TextDecoder().decode(toUint8Array2(raw)));
|
|
5728
5736
|
if (desc.id && desc.groupType === "data-sync" && !byId.has(desc.id)) {
|
|
5729
5737
|
const descriptor = desc;
|
|
5730
5738
|
descriptor.backends = await this.resolveAppDataGroupBackends(desc.id, descriptor);
|
|
5731
5739
|
byId.set(desc.id, descriptor);
|
|
5732
5740
|
}
|
|
5733
|
-
} catch {
|
|
5741
|
+
} catch (err) {
|
|
5742
|
+
const code = err?.code;
|
|
5743
|
+
if (code === "ENOENT" || err instanceof Error && /not\s*found/i.test(err.message)) {
|
|
5744
|
+
this.missingDescriptorFiles.add(filePath);
|
|
5745
|
+
}
|
|
5734
5746
|
}
|
|
5735
5747
|
}
|
|
5736
5748
|
}
|
package/dist/zen-fs-config.js
CHANGED
|
@@ -29412,6 +29412,12 @@ var ZenFSConfig = (() => {
|
|
|
29412
29412
|
* 见 `healEmptyBootstrapDescriptors()`。
|
|
29413
29413
|
*/
|
|
29414
29414
|
__publicField(this, "explicitEmptyDescriptors", /* @__PURE__ */ new Set());
|
|
29415
|
+
/**
|
|
29416
|
+
* 描述符文件路径 → 已确认在远端不存在。目录清单按 ETag 复用,删除不会
|
|
29417
|
+
* 改变 ETag,所以清单会长期保留已删除的文件名;这里记住 404 结果,
|
|
29418
|
+
* 避免每次 `listAppDataGroups()` 都为同一批死文件再发一次 GET。
|
|
29419
|
+
*/
|
|
29420
|
+
__publicField(this, "missingDescriptorFiles", /* @__PURE__ */ new Set());
|
|
29415
29421
|
/**
|
|
29416
29422
|
* Tracks the background initial sync started by createConfigRepo().
|
|
29417
29423
|
* `flush()` and `dispose()` will await this if it hasn't completed yet,
|
|
@@ -32455,15 +32461,21 @@ var ZenFSConfig = (() => {
|
|
|
32455
32461
|
}
|
|
32456
32462
|
for (const entry of entries2) {
|
|
32457
32463
|
if (!entry.endsWith(".json")) continue;
|
|
32464
|
+
const filePath = `${dir}/${entry}`;
|
|
32465
|
+
if (this.missingDescriptorFiles.has(filePath)) continue;
|
|
32458
32466
|
try {
|
|
32459
|
-
const raw = await this.cachedFS.readFile(
|
|
32467
|
+
const raw = await this.cachedFS.readFile(filePath);
|
|
32460
32468
|
const desc = JSON.parse(new TextDecoder().decode(toUint8Array2(raw)));
|
|
32461
32469
|
if (desc.id && desc.groupType === "data-sync" && !byId.has(desc.id)) {
|
|
32462
32470
|
const descriptor = desc;
|
|
32463
32471
|
descriptor.backends = await this.resolveAppDataGroupBackends(desc.id, descriptor);
|
|
32464
32472
|
byId.set(desc.id, descriptor);
|
|
32465
32473
|
}
|
|
32466
|
-
} catch {
|
|
32474
|
+
} catch (err2) {
|
|
32475
|
+
const code = err2?.code;
|
|
32476
|
+
if (code === "ENOENT" || err2 instanceof Error && /not\s*found/i.test(err2.message)) {
|
|
32477
|
+
this.missingDescriptorFiles.add(filePath);
|
|
32478
|
+
}
|
|
32467
32479
|
}
|
|
32468
32480
|
}
|
|
32469
32481
|
}
|