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
Description
-
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:
- Load up js-ipfs package in browser session.
- Start a browser node
- 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)