From e11972c20c126648a5ea92506f94e3def8ce1394 Mon Sep 17 00:00:00 2001 From: "Akintayo A. Olusegun" Date: Tue, 8 Nov 2022 14:11:39 +0400 Subject: [PATCH 1/2] Fix orphaned data for stream warning logs. Signed-off-by: Akintayo A. Olusegun --- app/scripts/lib/stream-utils.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/scripts/lib/stream-utils.js b/app/scripts/lib/stream-utils.js index 6fa4d7a6cf88..31bcc9e5889f 100644 --- a/app/scripts/lib/stream-utils.js +++ b/app/scripts/lib/stream-utils.js @@ -9,6 +9,13 @@ import pump from 'pump'; */ export function setupMultiplex(connectionStream) { const mux = new ObjectMultiplex(); + /** + * We are using this streams to send keep alive message between backend/ui without setting up a multiplexer + * We need to tell the multiplexer to ignore them, else we get the " orphaned data for stream " warnings + */ + mux.ignoreStream('CONNECTION_READY'); + mux.ignoreStream('ACK_KEEP_ALIVE_MESSAGE'); + mux.ignoreStream('WORKER_KEEP_ALIVE_MESSAGE'); pump(connectionStream, mux, connectionStream, (err) => { if (err) { console.error(err); From 5ed0dab623bf780a845b9e9f596986e57c064109 Mon Sep 17 00:00:00 2001 From: "Akintayo A. Olusegun" Date: Tue, 8 Nov 2022 14:12:33 +0400 Subject: [PATCH 2/2] Refrence the fix in repo Signed-off-by: Akintayo A. Olusegun --- app/scripts/lib/stream-utils.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/scripts/lib/stream-utils.js b/app/scripts/lib/stream-utils.js index 31bcc9e5889f..cac30c06663f 100644 --- a/app/scripts/lib/stream-utils.js +++ b/app/scripts/lib/stream-utils.js @@ -12,6 +12,7 @@ export function setupMultiplex(connectionStream) { /** * We are using this streams to send keep alive message between backend/ui without setting up a multiplexer * We need to tell the multiplexer to ignore them, else we get the " orphaned data for stream " warnings + * https://github.com/MetaMask/object-multiplex/blob/280385401de84f57ef57054d92cfeb8361ef2680/src/ObjectMultiplex.ts#L63 */ mux.ignoreStream('CONNECTION_READY'); mux.ignoreStream('ACK_KEEP_ALIVE_MESSAGE');