Skip to content

chore: set bufferSize to 1 when bufferSize is less than or equal to 0 is in BoundedStreamBufferer#283

Merged
kessplas merged 1 commit intomainfrom
bounded-stream-buffer-fix
May 29, 2024
Merged

chore: set bufferSize to 1 when bufferSize is less than or equal to 0 is in BoundedStreamBufferer#283
kessplas merged 1 commit intomainfrom
bounded-stream-buffer-fix

Conversation

@kessplas
Copy link
Contributor

Issue #, if available:

No issue, but see https://github.com/aws/amazon-s3-encryption-client-java/actions/runs/9288503510/job/25560124190 for failed CI run

Description of changes:

When the inputLength in the stream tests is equal or less than 8, the bufferSize parameter gets set to 0 which, due to how the InputStreamSubscriber is implemented, becomes an AssertionError later on.

The easiest fix is to set the the bufferSize to 1 in BoundedStreamBufferer; this retains the spirit of the utility, which is to read the stream chunk by chunk such that the entire stream isn't read all at once.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Check any applicable:

  • Were any files moved? Moving files changes their URL, which breaks all hyperlinks to the files.

@kessplas kessplas changed the title fix: set bufferSize to 1 when bufferSize is less than or equal to 0 is in BoundedStreamBufferer chore: set bufferSize to 1 when bufferSize is less than or equal to 0 is in BoundedStreamBufferer May 29, 2024
@kessplas kessplas marked this pull request as ready for review May 29, 2024 18:26
@kessplas kessplas requested a review from a team as a code owner May 29, 2024 18:26
Copy link
Contributor

@seebees seebees left a comment

Choose a reason for hiding this comment

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

LGTM

@kessplas kessplas merged commit adb6d3b into main May 29, 2024
@kessplas kessplas deleted the bounded-stream-buffer-fix branch May 29, 2024 19:47
josecorella pushed a commit that referenced this pull request Jun 18, 2024
## [3.1.3](v3.1.2...v3.1.3) (2024-06-18)

### Fixes

* Ranged gets with RSA keys ([#288](#288)) ([5d7fc31](5d7fc31))
* set bufferSize to 1 when bufferSize is less than or equal to 0 in BoundedStreamBufferer ([#283](#283)) ([adb6d3b](adb6d3b))

### Maintenance

* add support policy ([#236](#236)) ([264168d](264168d))
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.

2 participants