dignifiedquire / pull-length-prefixed

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

fix: empty streams #23

Closed jacobheun closed 5 years ago

jacobheun commented 5 years ago

The recent update to better support empty streams was ending streams when an empty value was decoded, it shouldn't, as this prevents other values from being returned. A receiver may respond with an empty message and then continue to write subsequent responses on the same stream.

codecov-io commented 5 years ago

Codecov Report

Merging #23 into master will decrease coverage by 0.24%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #23      +/-   ##
==========================================
- Coverage   94.73%   94.49%   -0.25%     
==========================================
  Files           3        3              
  Lines         114      109       -5     
==========================================
- Hits          108      103       -5     
  Misses          6        6
Impacted Files Coverage Δ
src/decode.js 98.63% <ø> (+1.29%) :arrow_up:
src/encode.js 83.87% <100%> (-4.37%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7090f5d...a6177e1. Read the comment docs.

jacobheun commented 5 years ago

@alanshaw i've updated the code and tests to better match expected pull-stream behavior