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: propagate missing chunk error #252

Merged
merged 2 commits into from
May 5, 2023

Conversation

appcypher
Copy link
Member

@appcypher appcypher commented May 3, 2023

Summary

As it is, the file content streaming implementation can panic if there is a missing chunk.
We should avoid unwrap as much as possible in the code and allow user to handle errors. This PR fixes that with the try_stream_ext

Test plan (required)

scripts/rs-wnfs.sh test

Closing issues

Fixes #228

@appcypher appcypher requested a review from a team as a code owner May 3, 2023 16:25
@appcypher appcypher changed the title Propagate missing chunk error fix: propagate missing chunk error May 3, 2023
@codecov
Copy link

codecov bot commented May 3, 2023

Codecov Report

Merging #252 (7652f67) into main (bccc0ec) will increase coverage by 0.05%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #252      +/-   ##
==========================================
+ Coverage   61.72%   61.77%   +0.05%     
==========================================
  Files          35       35              
  Lines        2662     2676      +14     
  Branches      655      657       +2     
==========================================
+ Hits         1643     1653      +10     
- Misses        566      567       +1     
- Partials      453      456       +3     
Impacted Files Coverage Δ
wnfs/src/private/file.rs 79.92% <80.00%> (-0.15%) ⬇️
wnfs/src/private/directory.rs 71.39% <100.00%> (ø)

... and 4 files with indirect coverage changes

Copy link
Member

@matheus23 matheus23 left a comment

Choose a reason for hiding this comment

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

Aw nice. The negative test is
chef kiss

Just needs newer clippy to be made happy.

@appcypher appcypher merged commit 4c16dcd into main May 5, 2023
@appcypher appcypher deleted the appcypher/missing-chunk-no-unwrap branch May 5, 2023 11:04
@github-actions github-actions bot mentioned this pull request May 5, 2023
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.

Fix erroneous .unwrap()
2 participants