Skip to content

Commit

Permalink
Fix orphaned data warning (#16413)
Browse files Browse the repository at this point in the history
  • Loading branch information
segun authored Nov 8, 2022
1 parent 1a9ebab commit aba3b94
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/scripts/lib/stream-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ 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
* https://github.com/MetaMask/object-multiplex/blob/280385401de84f57ef57054d92cfeb8361ef2680/src/ObjectMultiplex.ts#L63
*/
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);
Expand Down

0 comments on commit aba3b94

Please sign in to comment.