Skip to content

Commit

Permalink
add more debug
Browse files Browse the repository at this point in the history
  • Loading branch information
weboko committed Oct 1, 2024
1 parent ffd71c3 commit ce3a790
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions packages/core/src/lib/stream_manager/stream_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ export class StreamManager {
const peerId = peer.id.toString();

const scheduledStream = this.streamPool.get(peerId);
this.streamPool.delete(peerId);
await scheduledStream;

if (scheduledStream) {
this.streamPool.delete(peerId);
await scheduledStream;
}

const stream = this.getOpenStreamForCodec(peer.id);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,11 @@ describe("Waku Filter V2: Subscribe: Single Service Node", function () {

// Send a unique message on each topic.
for (let i = 0; i < topicCount; i++) {
const now = Date.now();
await waku.lightPush.send(td.encoders[i], {
payload: utf8ToBytes(`Message for Topic ${i + 1}`)
});
console.log("DEBUG:", Date.now() - now);
}

// Verify that each message was received on the corresponding topic.
Expand All @@ -291,8 +293,7 @@ describe("Waku Filter V2: Subscribe: Single Service Node", function () {
messageCollector.verifyReceivedMessage(index, {
expectedContentTopic: topic,
expectedMessageText: `Message for Topic ${index + 1}`,
expectedPubsubTopic: TestPubsubTopic,
checkTimestamp: false
expectedPubsubTopic: TestPubsubTopic
});
});
});
Expand Down

0 comments on commit ce3a790

Please sign in to comment.