Respect transfer stream ownership and IO contracts - #176
Open
OskarEichler wants to merge 4 commits into
Open
Conversation
Author
|
I did another pass over the stream contract and covered one additional edge case: a readable object returning an empty chunk is now treated as EOF rather than producing repeated zero-byte SFTP writes. Focused upload/download tests pass (22 runs, 176 assertions). The full suite otherwise reaches 435/436 passing locally; the sole failure is the pre-existing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem: Transfers closed caller-owned streams, uploads required pos/size even though the API accepts readable streams, and an empty successful DATA response could cause downloads to retry forever.
Fix: Track stream ownership and upload offsets explicitly, support streams without seek/size methods, close only library-opened files, and treat empty DATA as EOF.
Regression coverage: Adds focused upstream cases for caller-owned streams, read-only upload streams, and empty DATA. Upload: 11 runs / 86 assertions; download: 10 runs / 89 assertions. Full suite: 435 runs / 1,201 assertions with only the pre-existing Ruby 4 StartTest positional-hash/keyword expectation failure.