antietcd 1.1.2 → 1.1.3
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/antietcd.js +1 -1
- package/etctree.js +12 -10
- package/package.json +1 -1
package/antietcd.js
CHANGED
|
@@ -17,7 +17,7 @@ const AntiPersistence = require('./antipersistence.js');
|
|
|
17
17
|
const AntiCluster = require('./anticluster.js');
|
|
18
18
|
const { runCallbacks, de64, b64, RequestError } = require('./common.js');
|
|
19
19
|
|
|
20
|
-
const VERSION = '1.1.
|
|
20
|
+
const VERSION = '1.1.3';
|
|
21
21
|
|
|
22
22
|
class AntiEtcd extends EventEmitter
|
|
23
23
|
{
|
package/etctree.js
CHANGED
|
@@ -251,6 +251,10 @@ class EtcTree
|
|
|
251
251
|
{
|
|
252
252
|
delete this.leases[cur_old.lease].keys[key];
|
|
253
253
|
}
|
|
254
|
+
if (cur_new.lease && !this.leases[cur_new.lease])
|
|
255
|
+
{
|
|
256
|
+
console.log('BUG: restoring a key with unknown lease '+cur_new.lease);
|
|
257
|
+
}
|
|
254
258
|
cur_old.lease = cur_new.lease;
|
|
255
259
|
if (cur_new.lease && this.leases[cur_new.lease])
|
|
256
260
|
{
|
|
@@ -277,17 +281,14 @@ class EtcTree
|
|
|
277
281
|
{
|
|
278
282
|
if (!cur_old.children[k])
|
|
279
283
|
{
|
|
280
|
-
cur_old.children[k] =
|
|
281
|
-
}
|
|
282
|
-
else
|
|
283
|
-
{
|
|
284
|
-
this._restore_diff(
|
|
285
|
-
update_only, cur_old.children[k], cur_new.children[k],
|
|
286
|
-
prefix === null ? k : prefix+'/'+k,
|
|
287
|
-
cur_old.children[k].watchers ? [ ...watchers, ...cur_old.children[k].watchers ] : watchers,
|
|
288
|
-
notifications
|
|
289
|
-
);
|
|
284
|
+
cur_old.children[k] = {};
|
|
290
285
|
}
|
|
286
|
+
this._restore_diff(
|
|
287
|
+
update_only, cur_old.children[k], cur_new.children[k],
|
|
288
|
+
prefix === null ? k : prefix+'/'+k,
|
|
289
|
+
cur_old.children[k].watchers ? [ ...watchers, ...cur_old.children[k].watchers ] : watchers,
|
|
290
|
+
notifications
|
|
291
|
+
);
|
|
291
292
|
}
|
|
292
293
|
if (!update_only)
|
|
293
294
|
{
|
|
@@ -818,6 +819,7 @@ class EtcTree
|
|
|
818
819
|
delete this.leases[cur.lease].keys[prefix === null ? '' : prefix];
|
|
819
820
|
}
|
|
820
821
|
cur.value = null;
|
|
822
|
+
cur.lease = null;
|
|
821
823
|
cur.version = 0;
|
|
822
824
|
cur.create_revision = null;
|
|
823
825
|
cur.mod_revision = cur_revision;
|