hypercore-storage 1.9.5 → 1.10.0
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/index.js +6 -4
- package/migrations/0/index.js +1 -1
- package/package.json +1 -1
- package/spec/hyperschema/index.js +6 -2
package/index.js
CHANGED
|
@@ -406,10 +406,12 @@ class CorestoreStorage {
|
|
|
406
406
|
const end = core.core(ptr.corePointer + 1)
|
|
407
407
|
tx.tryDeleteRange(start, end)
|
|
408
408
|
|
|
409
|
-
|
|
410
|
-
const
|
|
411
|
-
|
|
412
|
-
|
|
409
|
+
if (sessions) {
|
|
410
|
+
for (const { dataPointer } of sessions) {
|
|
411
|
+
const start = core.data(dataPointer)
|
|
412
|
+
const end = core.data(dataPointer + 1)
|
|
413
|
+
tx.tryDeleteRange(start, end)
|
|
414
|
+
}
|
|
413
415
|
}
|
|
414
416
|
|
|
415
417
|
return tx.flush()
|
package/migrations/0/index.js
CHANGED
|
@@ -373,7 +373,7 @@ async function core (core, { version, dryRun = true, gc = true }) {
|
|
|
373
373
|
}
|
|
374
374
|
|
|
375
375
|
const oplog = await readOplog(files.oplog)
|
|
376
|
-
if (!oplog) throw new Error('No oplog available for ' + files.oplog)
|
|
376
|
+
if (!oplog) throw new Error('No oplog available for ' + files.oplog + ', length = ' + (head ? head.length : 0) + ', writable = ' + (!!auth.keyPair))
|
|
377
377
|
|
|
378
378
|
const treeData = new TreeSlicer()
|
|
379
379
|
|
package/package.json
CHANGED
|
@@ -245,6 +245,8 @@ const encoding8 = {
|
|
|
245
245
|
|
|
246
246
|
// @core/manifest.signers
|
|
247
247
|
const encoding9_4 = c.array(encoding7)
|
|
248
|
+
// @core/manifest.linked
|
|
249
|
+
const encoding9_6 = c.array(c.fixed32)
|
|
248
250
|
|
|
249
251
|
// @core/manifest
|
|
250
252
|
const encoding9 = {
|
|
@@ -256,12 +258,13 @@ const encoding9 = {
|
|
|
256
258
|
encoding9_4.preencode(state, m.signers)
|
|
257
259
|
|
|
258
260
|
if (m.prologue) encoding8.preencode(state, m.prologue)
|
|
261
|
+
if (m.linked) encoding9_6.preencode(state, m.linked)
|
|
259
262
|
},
|
|
260
263
|
encode (state, m) {
|
|
261
264
|
const flags =
|
|
262
265
|
(m.allowPatch ? 1 : 0) |
|
|
263
266
|
(m.prologue ? 2 : 0) |
|
|
264
|
-
(m.
|
|
267
|
+
(m.linked ? 4 : 0)
|
|
265
268
|
|
|
266
269
|
c.uint.encode(state, m.version)
|
|
267
270
|
c.uint.encode(state, flags)
|
|
@@ -270,6 +273,7 @@ const encoding9 = {
|
|
|
270
273
|
encoding9_4.encode(state, m.signers)
|
|
271
274
|
|
|
272
275
|
if (m.prologue) encoding8.encode(state, m.prologue)
|
|
276
|
+
if (m.linked) encoding9_6.encode(state, m.linked)
|
|
273
277
|
},
|
|
274
278
|
decode (state) {
|
|
275
279
|
const r0 = c.uint.decode(state)
|
|
@@ -282,7 +286,7 @@ const encoding9 = {
|
|
|
282
286
|
allowPatch: (flags & 1) !== 0,
|
|
283
287
|
signers: encoding9_4.decode(state),
|
|
284
288
|
prologue: (flags & 2) !== 0 ? encoding8.decode(state) : null,
|
|
285
|
-
|
|
289
|
+
linked: (flags & 4) !== 0 ? encoding9_6.decode(state) : null
|
|
286
290
|
}
|
|
287
291
|
}
|
|
288
292
|
}
|