fix stream phase 9 again

This commit is contained in:
Andre Staltz 2023-12-13 16:15:29 +02:00
parent d1ccc3426e
commit 6ba8d55dde
No known key found for this signature in database
GPG Key ID: 9EDE23EA7E8A4890
1 changed files with 1 additions and 1 deletions

View File

@ -369,6 +369,7 @@ class SyncStream extends Pipeable {
#consumeMissingMsgs(id, msgsForMe) { #consumeMissingMsgs(id, msgsForMe) {
// prettier-ignore // prettier-ignore
this.#debug('%s Stream IN9: got %s msgs in %s', this.#myId, msgsForMe.length, id) 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.#requested.delete(id)
this.#localHave.delete(id) this.#localHave.delete(id)
@ -381,7 +382,6 @@ class SyncStream extends Pipeable {
if (msgsForMe.length === 0) return if (msgsForMe.length === 0) return
const goal = this.#goals.get(id) const goal = this.#goals.get(id)
if (!goal) throw new Error(`No goal found for "${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') if (!localWantRange) throw new Error('local want-range not set')
try { try {
this.#algo.commit(id, msgsForMe, goal, localWantRange) this.#algo.commit(id, msgsForMe, goal, localWantRange)