Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: empty streams #23

Merged
merged 3 commits into from
May 3, 2019
Merged

fix: empty streams #23

merged 3 commits into from
May 3, 2019

Conversation

jacobheun
Copy link
Collaborator

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
Copy link

codecov-io commented May 1, 2019

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%) ⬆️
src/encode.js 83.87% <100%> (-4.37%) ⬇️

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 jacobheun mentioned this pull request May 1, 2019
1 task
test/fromReader.spec.js Outdated Show resolved Hide resolved
test/index.spec.js Outdated Show resolved Hide resolved
).to.be.eql([
Buffer.alloc(0),
Buffer.from('more data')
])
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense, we should be able to pull an empty buffer.

@jacobheun
Copy link
Collaborator Author

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

Copy link

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dignifiedquire dignifiedquire merged commit 6f744c5 into master May 3, 2019
@dignifiedquire dignifiedquire deleted the fix/empty-streams branch May 3, 2019 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants