dignifiedquire / pull-length-prefixed

Streaming length prefixed buffers with pull-streams
MIT License
8 stars 18 forks source link

Tests and guards for failure cases #8

Closed kumavis closed 5 years ago

kumavis commented 7 years ago

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

dignifiedquire commented 7 years ago

Thank you @kumavis :) will wait for response in the pull-reader issue for merging this.

kumavis commented 7 years ago

just noticed the lint errors, addressing

olizilla commented 6 years ago

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?

jacobheun commented 6 years ago

@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.

jacobheun commented 6 years ago

@dignifiedquire we should be able to close this in favor of the rebased version #16

jacobheun commented 5 years ago

Merged via https://github.com/dignifiedquire/pull-length-prefixed/pull/16