Closed kumavis closed 5 years ago
Thank you @kumavis :) will wait for response in the pull-reader issue for merging this.
just noticed the lint errors, addressing
This just turned up in a hard to debug issue in libp2p-switch
. Looks like the suggestions in https://github.com/dominictarr/pull-reader/issues/5 are agreed, but it's waiting on someone to do the work. Could we get this PR merged in the meantime?
@kumavis if you rebase with master you should be able to add the skipped test in for this. pull-reader ^1.3.0 should have the needed fix.
@dignifiedquire we should be able to close this in favor of the rebased version #16
pull streams emit 'true' or an error on drain. ( see https://github.com/pull-stream/pull-stream#source-aka-readable )
I was getting a case where the source was unexpectedly ending, and 'true' was being passed up as the error. decodeFromReader seemed like the correct place to handle this case, as it is the end of pull streams and the start of a error-first-cb api.
I fixed that issue and added some additional protections.
note: the
invalid prefix
test is skipped until resolution of this issue: https://github.com/dominictarr/pull-reader/issues/5