diff --git a/lib/stream.js b/lib/stream.js index 6704907..e82be8c 100644 --- a/lib/stream.js +++ b/lib/stream.js @@ -248,7 +248,7 @@ class SyncStream extends Pipeable { for (const id of this.#requested) { if (!this.#canSend()) return - this.#sendLocalHave(id) + this.write({ id, phase: 0 }) } } @@ -257,6 +257,9 @@ class SyncStream extends Pipeable { const { id, phase, payload } = data switch (phase) { + case 0: { + return this.#sendLocalHave(id) + } case 1: { return this.#sendLocalHaveAndWant(id, payload) }