Skip to content

with gossipsub subscribers may not receive the first couple of messages #331

@hugomrdias

Description

@hugomrdias

While trying to sync js repos with go-ipfs 0.5.x i notice pubsub tests were failing for js-ipfs-http-client the specific test works like this:

  1. peer1 swarm connects to peer2
  2. peer1 and peer2 subscribe to topicA
  3. peer2 runs ipfs.pubsub.peers() multiple times until it sees peer1
  4. peer2 publishes a msg to the topic
  5. test asserts that both peers receive the msg

So this test started to fail with go-ipfs 0.5 talking to @aschmahmann we discovered that this behaviour is due to 0.5 defaulting to gossipsub because with floodsub the test passes.

To make the test pass with gossipsub i needed to add a ~2s (may work with less just a random number) delay between step 3 and 4.

Can we remove the need for that delay and make gossipsub work like floodsub ?

issue ipfs/js-ipfs#3030
pr ipfs/js-ipfs#3013

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions