mirror of https://codeberg.org/pzp/pzp-sync.git
fix stream phase 9 when no msgs received
This commit is contained in:
parent
782b435a98
commit
d1ccc3426e
|
@ -370,10 +370,6 @@ class SyncStream extends Pipeable {
|
||||||
// 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 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')
|
|
||||||
this.#requested.delete(id)
|
this.#requested.delete(id)
|
||||||
this.#localHave.delete(id)
|
this.#localHave.delete(id)
|
||||||
this.#localWant.delete(id)
|
this.#localWant.delete(id)
|
||||||
|
@ -381,7 +377,12 @@ class SyncStream extends Pipeable {
|
||||||
this.#remoteWant.delete(id)
|
this.#remoteWant.delete(id)
|
||||||
this.#receivableMsgs.delete(id)
|
this.#receivableMsgs.delete(id)
|
||||||
this.#sendableMsgs.delete(id)
|
this.#sendableMsgs.delete(id)
|
||||||
|
|
||||||
if (msgsForMe.length === 0) return
|
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 {
|
try {
|
||||||
this.#algo.commit(id, msgsForMe, goal, localWantRange)
|
this.#algo.commit(id, msgsForMe, goal, localWantRange)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
Loading…
Reference in New Issue