autobee 2.0.0-rc.7 → 2.0.0-rc.8
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/lib/topo.js +5 -1
- package/package.json +1 -1
package/lib/topo.js
CHANGED
|
@@ -255,8 +255,12 @@ async function getOplogBatch(undo, core, length, weight, index) {
|
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
function getLocalBatch(undo, writer, length, weight, index) {
|
|
258
|
+
if (writer.core.closed) throw new Error('Writer core is closed')
|
|
259
|
+
|
|
258
260
|
if (length > writer.core.length) {
|
|
259
|
-
if (!writer.pending)
|
|
261
|
+
if (!writer.pending) {
|
|
262
|
+
throw new Error(`No local nodes: looking for ${length}, found ${writer.core.length}`)
|
|
263
|
+
}
|
|
260
264
|
|
|
261
265
|
let i = 0
|
|
262
266
|
while (i < writer.pending.length) {
|