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.

Lag on catReadableStream (possibly other stream methods as well) #1706

Closed
libp2p/js-libp2p-bootstrap
#86
@lifeBCE

Description

@lifeBCE
  • Version:
    0.33.1

  • Platform:
    Mac OS X 10.12.6
    Chrome: Version 70.0.3538.77 (Official Build) (64-bit)
    FireFox: 63.0.1 (64-bit)

  • Subsystem:
    ?

Type:

Bug (maybe Enhancement?)

Severity:

High

Description:

When using js-ipfs as a client in a browser, executing node.files.catReadableStream starts the blocks streaming into the websocket connections immediately but it takes sometimes over 10 seconds before the stream triggers the first data event.

Basically, more than 10 seconds of lag between these two lines:

    this.stream = this.state.node.files.catReadableStream(hash)
    this.stream.on('data', (block) => {});

But as soon as the first line is executed, I see blocks coming across the websocket instantly. Is this by design or is there a problem here?

Steps to reproduce the error:

  1. Load up js-ipfs package in browser session.
  2. Start a browser node
  3. Once peers are connected, call catReadableStream on any hash (larger files work better as the process is really over before you know what happened on smaller files)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium: Good to have, but can wait until someone steps upexp/expertHaving worked on the specific codebase is importantkind/bugA bug in existing code (including security flaws)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions