From 2311a595b28b9e7c99fcd96044cf098ad975c70c Mon Sep 17 00:00:00 2001 From: gabrielmer <101006718+gabrielmer@users.noreply.github.com> Date: Thu, 30 May 2024 10:28:50 +0200 Subject: [PATCH] fix: increasing maxInboundStreams for lightpush from 32 to 100 (#2021) * increasing maxInboundStreams for lightpush from 32 to 100 * allowing test to fail --- packages/core/src/lib/filter/index.ts | 10 +++++--- .../filter/single_node/subscribe.node.spec.ts | 24 +++++++------------ 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/packages/core/src/lib/filter/index.ts b/packages/core/src/lib/filter/index.ts index b6dc724a32..11cada6b70 100644 --- a/packages/core/src/lib/filter/index.ts +++ b/packages/core/src/lib/filter/index.ts @@ -48,9 +48,13 @@ export class FilterCore extends BaseProtocol implements IBaseProtocolCore { options ); - libp2p.handle(FilterCodecs.PUSH, this.onRequest.bind(this)).catch((e) => { - log.error("Failed to register ", FilterCodecs.PUSH, e); - }); + libp2p + .handle(FilterCodecs.PUSH, this.onRequest.bind(this), { + maxInboundStreams: 100 + }) + .catch((e) => { + log.error("Failed to register ", FilterCodecs.PUSH, e); + }); } private onRequest(streamData: IncomingStreamData): void { diff --git a/packages/tests/tests/filter/single_node/subscribe.node.spec.ts b/packages/tests/tests/filter/single_node/subscribe.node.spec.ts index bead2d8db2..6ef09e3182 100644 --- a/packages/tests/tests/filter/single_node/subscribe.node.spec.ts +++ b/packages/tests/tests/filter/single_node/subscribe.node.spec.ts @@ -262,23 +262,15 @@ describe("Waku Filter V2: Subscribe: Single Service Node", function () { }); } - // Open issue here: https://github.com/waku-org/js-waku/issues/1790 - // That's why we use the try catch block - try { - // Verify that each message was received on the corresponding topic. - expect(await messageCollector.waitForMessages(topicCount)).to.eq(true); - td.contentTopics.forEach((topic, index) => { - messageCollector.verifyReceivedMessage(index, { - expectedContentTopic: topic, - expectedMessageText: `Message for Topic ${index + 1}`, - expectedPubsubTopic: TestPubsubTopic - }); + // Verify that each message was received on the corresponding topic. + expect(await messageCollector.waitForMessages(topicCount)).to.eq(true); + td.contentTopics.forEach((topic, index) => { + messageCollector.verifyReceivedMessage(index, { + expectedContentTopic: topic, + expectedMessageText: `Message for Topic ${index + 1}`, + expectedPubsubTopic: TestPubsubTopic }); - } catch (error) { - console.warn( - "This test still fails because of https://github.com/waku-org/js-waku/issues/1790" - ); - } + }); }); it("Error when try to subscribe to more than 101 topics (new limit)", async function () {