From 404925844b84585af91d608beb46ff04ab188efd Mon Sep 17 00:00:00 2001 From: Robert Zabel Date: Tue, 20 Aug 2024 16:37:10 +0200 Subject: [PATCH] don't push twice for the same message to avoid race conditions --- index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.js b/index.js index dfa07553..ef097e23 100644 --- a/index.js +++ b/index.js @@ -665,8 +665,7 @@ class Wire extends Duplex { view.setUint32(5 + (4 * i), numbers[i]) } - this._push(buffer) - if (data) this._push(data) + this._push(concat([buffer,data ?? []])) } _push (data) {