From 129ac775f1934f8f8e51006c12c6f19d8543954e Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Mon, 13 Jun 2022 16:15:09 +0100 Subject: [PATCH] fix: onMessage assignment should be undefined not null (#4131) Assign according to the type --- packages/ipfs-core/src/components/libp2p.js | 5 ++++- packages/ipfs-core/src/components/pubsub.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/ipfs-core/src/components/libp2p.js b/packages/ipfs-core/src/components/libp2p.js index 0c4d752c35..41285e232e 100644 --- a/packages/ipfs-core/src/components/libp2p.js +++ b/packages/ipfs-core/src/components/libp2p.js @@ -129,7 +129,10 @@ function getLibp2pOptions ({ options, config, datastore, keychainConfig, peerId, }) ], streamMuxers: [ - new Mplex() + new Mplex({ + // temporary fix until we can limit streams on a per-protocol basis + maxStreamsPerConnection: Infinity + }) ], connectionEncryption: [ NOISE diff --git a/packages/ipfs-core/src/components/pubsub.js b/packages/ipfs-core/src/components/pubsub.js index ab92dc6875..4f584e63aa 100644 --- a/packages/ipfs-core/src/components/pubsub.js +++ b/packages/ipfs-core/src/components/pubsub.js @@ -98,7 +98,7 @@ export function createPubsub ({ network, config }) { // no more pubsub handlers, remove message listener if (Object.keys(handlers).length === 0) { libp2p.pubsub.removeEventListener('message', onMessage) - onMessage = null + onMessage = undefined } }