Skip to content

fix: include one-byte final upload slices - #2164

Open
Vinay Kumar (Vcode2407) wants to merge 1 commit into
microsoftgraph:mainfrom
Vcode2407:fix/upload-final-byte
Open

Vinay Kumar (Vcode2407) wants to merge 1 commit into
microsoftgraph:mainfrom
Vcode2407:fix/upload-final-byte

Conversation

@Vcode2407

Copy link
Copy Markdown

Changes proposed in this pull request

A file that is exactly one byte larger than a multiple of the slice size can get stuck with its final byte unuploaded. The slice planner uses inclusive offsets, so this change schedules a one-byte slice when its start and end offsets are equal.

The regression test uses a 320 KiB slice size and a file one byte larger. It verifies that the second slice covers exactly the final byte.

Fixes microsoftgraph/msgraph-sdk-java#2581

Validation

Ran mvn verify with JDK 21. All 80 tests passed, including the new regression test, and SpotBugs reported no findings.

@Vcode2407
Vinay Kumar (Vcode2407) requested a review from a team as a code owner November 11, 2026 14:06

This branch has not been deployed

No deployments
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.

LargeFileUpload problem if 1 byte left from last slice

1 participant