zen-fs-config 0.5.11 → 0.5.13
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.js +9 -3
- package/dist/index.mjs +9 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -876,7 +876,9 @@ var ConfigRepo = class {
|
|
|
876
876
|
for (const tombstone of tombstones) {
|
|
877
877
|
const tVersionPath = versionPathFor(tombstone.path);
|
|
878
878
|
const existedOnPrimary = await this.safeExists(this.cachedFS, tombstone.path);
|
|
879
|
-
|
|
879
|
+
if (existedOnPrimary) {
|
|
880
|
+
console.log(`[ConfigRepo] tombstone check: ${tombstone.path} on primary \u2192 EXISTS`);
|
|
881
|
+
}
|
|
880
882
|
if (existedOnPrimary) {
|
|
881
883
|
try {
|
|
882
884
|
await this.cachedFS.unlink(tombstone.path);
|
|
@@ -892,8 +894,8 @@ var ConfigRepo = class {
|
|
|
892
894
|
}
|
|
893
895
|
for (const [replicaId, replica] of this.replicaBackends) {
|
|
894
896
|
const existed = await this.safeExists(replica.instance, tombstone.path);
|
|
895
|
-
console.log(`[ConfigRepo] tombstone check: ${tombstone.path} on ${replicaId} \u2192 ${existed ? "EXISTS" : "not found"}`);
|
|
896
897
|
if (existed) {
|
|
898
|
+
console.log(`[ConfigRepo] tombstone check: ${tombstone.path} on ${replicaId} \u2192 EXISTS`);
|
|
897
899
|
try {
|
|
898
900
|
await replica.instance.unlink(tombstone.path);
|
|
899
901
|
console.log(`[ConfigRepo] tombstone ${tombstone.path}: deleted on ${replicaId}`);
|
|
@@ -1852,7 +1854,11 @@ async function createConfigRepo(appId, options = {}) {
|
|
|
1852
1854
|
await primaryInstance.mkdir(META_DIR);
|
|
1853
1855
|
console.log(`[createConfigRepo] /.meta/ ready`);
|
|
1854
1856
|
} catch (err) {
|
|
1855
|
-
|
|
1857
|
+
const msg = err.message || "";
|
|
1858
|
+
if (msg.includes("File exists") || msg.includes("EEXIST") || err.code === "EEXIST") {
|
|
1859
|
+
} else {
|
|
1860
|
+
console.error(`[createConfigRepo] Failed to ensure /.meta/:`, err.message);
|
|
1861
|
+
}
|
|
1856
1862
|
}
|
|
1857
1863
|
try {
|
|
1858
1864
|
const groupTypeBytes = new TextEncoder().encode("config-sync");
|
package/dist/index.mjs
CHANGED
|
@@ -786,7 +786,9 @@ var ConfigRepo = class {
|
|
|
786
786
|
for (const tombstone of tombstones) {
|
|
787
787
|
const tVersionPath = versionPathFor(tombstone.path);
|
|
788
788
|
const existedOnPrimary = await this.safeExists(this.cachedFS, tombstone.path);
|
|
789
|
-
|
|
789
|
+
if (existedOnPrimary) {
|
|
790
|
+
console.log(`[ConfigRepo] tombstone check: ${tombstone.path} on primary \u2192 EXISTS`);
|
|
791
|
+
}
|
|
790
792
|
if (existedOnPrimary) {
|
|
791
793
|
try {
|
|
792
794
|
await this.cachedFS.unlink(tombstone.path);
|
|
@@ -802,8 +804,8 @@ var ConfigRepo = class {
|
|
|
802
804
|
}
|
|
803
805
|
for (const [replicaId, replica] of this.replicaBackends) {
|
|
804
806
|
const existed = await this.safeExists(replica.instance, tombstone.path);
|
|
805
|
-
console.log(`[ConfigRepo] tombstone check: ${tombstone.path} on ${replicaId} \u2192 ${existed ? "EXISTS" : "not found"}`);
|
|
806
807
|
if (existed) {
|
|
808
|
+
console.log(`[ConfigRepo] tombstone check: ${tombstone.path} on ${replicaId} \u2192 EXISTS`);
|
|
807
809
|
try {
|
|
808
810
|
await replica.instance.unlink(tombstone.path);
|
|
809
811
|
console.log(`[ConfigRepo] tombstone ${tombstone.path}: deleted on ${replicaId}`);
|
|
@@ -1762,7 +1764,11 @@ async function createConfigRepo(appId, options = {}) {
|
|
|
1762
1764
|
await primaryInstance.mkdir(META_DIR);
|
|
1763
1765
|
console.log(`[createConfigRepo] /.meta/ ready`);
|
|
1764
1766
|
} catch (err) {
|
|
1765
|
-
|
|
1767
|
+
const msg = err.message || "";
|
|
1768
|
+
if (msg.includes("File exists") || msg.includes("EEXIST") || err.code === "EEXIST") {
|
|
1769
|
+
} else {
|
|
1770
|
+
console.error(`[createConfigRepo] Failed to ensure /.meta/:`, err.message);
|
|
1771
|
+
}
|
|
1766
1772
|
}
|
|
1767
1773
|
try {
|
|
1768
1774
|
const groupTypeBytes = new TextEncoder().encode("config-sync");
|