Skip to content

Commit

Permalink
fix: increasing maxInboundStreams for lightpush from 32 to 100 (#2021)
Browse files Browse the repository at this point in the history
* increasing maxInboundStreams for lightpush from 32 to 100

* allowing test to fail
  • Loading branch information
gabrielmer authored May 30, 2024
1 parent e49e728 commit 2311a59
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
10 changes: 7 additions & 3 deletions packages/core/src/lib/filter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
24 changes: 8 additions & 16 deletions packages/tests/tests/filter/single_node/subscribe.node.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit 2311a59

Please sign in to comment.