zen-fs-config 0.5.1 → 0.5.2

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 CHANGED
@@ -1265,7 +1265,12 @@ var ConfigRepo = class {
1265
1265
  const current = await this.readAllBackendDescriptors();
1266
1266
  for (const desc of current) {
1267
1267
  if (!keepIds.has(desc.id)) {
1268
- await this.removeBackendDescriptor(desc.id);
1268
+ const descPath = this.backendFilePath(desc.id);
1269
+ try {
1270
+ await this.deleteFile(descPath);
1271
+ } catch {
1272
+ await this.removeBackendDescriptor(desc.id);
1273
+ }
1269
1274
  }
1270
1275
  }
1271
1276
  }
@@ -1320,14 +1325,27 @@ var ConfigRepo = class {
1320
1325
  if (!replica) {
1321
1326
  throw new Error(`Backend "${id}" is not a registered replica`);
1322
1327
  }
1328
+ const descPath = this.backendFilePath(id);
1329
+ try {
1330
+ await replica.instance.unlink(descPath);
1331
+ } catch {
1332
+ }
1333
+ try {
1334
+ await replica.instance.unlink(versionPathFor(descPath));
1335
+ } catch {
1336
+ }
1337
+ try {
1338
+ await this.deleteFile(descPath);
1339
+ } catch {
1340
+ await this.removeBackendDescriptor(id);
1341
+ }
1323
1342
  this.syncEngine.removePair(replica.pairId);
1324
1343
  console.log(`[ConfigRepo] removeBackend: sync pair ${replica.pairId} removed`);
1325
1344
  this.replicaBackends.delete(id);
1326
1345
  if (replica.instance?.dispose) {
1327
1346
  await replica.instance.dispose();
1328
1347
  }
1329
- await this.removeBackendDescriptor(id);
1330
- console.log(`[ConfigRepo] removeBackend: ${id} removed`);
1348
+ console.log(`[ConfigRepo] removeBackend: ${id} removed (tombstone written, remote cleaned)`);
1331
1349
  }
1332
1350
  // -----------------------------------------------------------------------
1333
1351
  // IConfigRepo — Group Type
package/dist/index.mjs CHANGED
@@ -1208,7 +1208,12 @@ var ConfigRepo = class {
1208
1208
  const current = await this.readAllBackendDescriptors();
1209
1209
  for (const desc of current) {
1210
1210
  if (!keepIds.has(desc.id)) {
1211
- await this.removeBackendDescriptor(desc.id);
1211
+ const descPath = this.backendFilePath(desc.id);
1212
+ try {
1213
+ await this.deleteFile(descPath);
1214
+ } catch {
1215
+ await this.removeBackendDescriptor(desc.id);
1216
+ }
1212
1217
  }
1213
1218
  }
1214
1219
  }
@@ -1263,14 +1268,27 @@ var ConfigRepo = class {
1263
1268
  if (!replica) {
1264
1269
  throw new Error(`Backend "${id}" is not a registered replica`);
1265
1270
  }
1271
+ const descPath = this.backendFilePath(id);
1272
+ try {
1273
+ await replica.instance.unlink(descPath);
1274
+ } catch {
1275
+ }
1276
+ try {
1277
+ await replica.instance.unlink(versionPathFor(descPath));
1278
+ } catch {
1279
+ }
1280
+ try {
1281
+ await this.deleteFile(descPath);
1282
+ } catch {
1283
+ await this.removeBackendDescriptor(id);
1284
+ }
1266
1285
  this.syncEngine.removePair(replica.pairId);
1267
1286
  console.log(`[ConfigRepo] removeBackend: sync pair ${replica.pairId} removed`);
1268
1287
  this.replicaBackends.delete(id);
1269
1288
  if (replica.instance?.dispose) {
1270
1289
  await replica.instance.dispose();
1271
1290
  }
1272
- await this.removeBackendDescriptor(id);
1273
- console.log(`[ConfigRepo] removeBackend: ${id} removed`);
1291
+ console.log(`[ConfigRepo] removeBackend: ${id} removed (tombstone written, remote cleaned)`);
1274
1292
  }
1275
1293
  // -----------------------------------------------------------------------
1276
1294
  // IConfigRepo — Group Type
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zen-fs-config",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Distributed config management library built on ZenFS, zen-fs-cache, and zen-fs-sync",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",