Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Cannot subscribe more than 5-6 topics [ipfs-http-client] #3741

@TheDiscordian

Description

@TheDiscordian
  • Version:
ipfs-core
{
  version: '0.8.0',
  repo: '10',
  commit: '81f944163f5a78ef15fdc23b2c488ba7f44af0be',
  'interface-ipfs-core': '^0.147.0'
}
ipfs-http-client
{
  version: '0.8.0',
  commit: 'ce693d7e8',
  repo: '11',
  system: 'amd64/linux',
  golang: 'go1.16.2'
}
  • Platform:
    Linux TheDesktop 5.10.42-1-MANJARO #1 SMP PREEMPT Thu Jun 3 14:37:11 UTC 2021 x86_64 GNU/Linux

  • Subsystem:
    ipfs-http-client

Severity:

High

Description:

Issue found at: https://stackoverflow.com/questions/68257274/cannot-subscribe-to-more-than-6-ipfs-pubsub-channels-with-ipfs-http-client

  1. Subscribe to 20 topics
  2. Publish to all 20 topics
  3. Only first 5-6 subs will get messages

Steps to reproduce the error:

First subscribe to the topics:

const { create } = require('ipfs-http-client');

async function echo(msg) {
	console.log(`TopicID: ${msg.topicIDs[0]}, Msg: ${new TextDecoder().decode(msg.data)}`);
}

async function run() {
	// connect to the default API address http://localhost:5001
	const client = create();
	console.log(await client.version());
	
	for (let i = 0; i < 20; i++) {
		await client.pubsub.subscribe(parseInt(i), echo);
	}
}

run();

Then publish:

#!/bin/bash
for i in {1..20}
do
   ipfs pubsub pub $i $i
done

Output is only:

{
  version: '0.8.0',
  commit: 'ce693d7e8',
  repo: '11',
  system: 'amd64/linux',
  golang: 'go1.16.2'
}
TopicID: 1, Msg: 1
TopicID: 2, Msg: 2
TopicID: 3, Msg: 3
TopicID: 4, Msg: 4
TopicID: 5, Msg: 5

Metadata

Metadata

Assignees

No one assigned

    Labels

    need/triageNeeds initial labeling and prioritization

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions