From 6ba8d55ddeefe8210907dbf2684da4cffc325d66 Mon Sep 17 00:00:00 2001 From: Andre Staltz Date: Wed, 13 Dec 2023 16:15:29 +0200 Subject: [PATCH] fix stream phase 9 again --- lib/stream.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stream.js b/lib/stream.js index 58510a1..61dd523 100644 --- a/lib/stream.js +++ b/lib/stream.js @@ -369,6 +369,7 @@ class SyncStream extends Pipeable { #consumeMissingMsgs(id, msgsForMe) { // prettier-ignore this.#debug('%s Stream IN9: got %s msgs in %s', this.#myId, msgsForMe.length, id) + const localWantRange = this.#localWant.get(id) this.#requested.delete(id) this.#localHave.delete(id) @@ -381,7 +382,6 @@ class SyncStream extends Pipeable { if (msgsForMe.length === 0) return const goal = this.#goals.get(id) if (!goal) throw new Error(`No goal found for "${id}"`) - const localWantRange = this.#localWant.get(id) if (!localWantRange) throw new Error('local want-range not set') try { this.#algo.commit(id, msgsForMe, goal, localWantRange)