Skip to content

Fix presigned URL download progress tracking for range requests and add listener tests#6977

Open
jencymaryjoseph wants to merge 1 commit into
feature/master/pre-signed-url-getobjectfrom
jencyjos/pre-signed-url-getobject/progress-tracking
Open

Fix presigned URL download progress tracking for range requests and add listener tests#6977
jencymaryjoseph wants to merge 1 commit into
feature/master/pre-signed-url-getobjectfrom
jencyjos/pre-signed-url-getobject/progress-tracking

Conversation

@jencymaryjoseph
Copy link
Copy Markdown
Contributor

Motivation and Context

Presigned URL downloads with a user-specified range and multipart enabled produced no progress tracking output. The wrapForNonSerialFileDownload wrapper was applied, but when range is set, multipart is skipped (single request) and split() is never called — so the wrapper's progress hooks never fire.

Modifications

  • GenericS3TransferManager.downloadFileWithPresignedUrl: Added range == null check — uses wrapForNonSerialFileDownload for multipart without range, falls back to wrapResponseTransformer when range is set.
  • GenericS3TransferManager.downloadWithPresignedUrl: Same range == null check.

Testing

  • S3TransferManagerListenerTest: Added TransferListener callback verification tests for presigned URL downloads — verifies transferInitiated, bytesTransferred, transferComplete fire on success, and transferInitiated, transferFailed fire on failure.
  • S3TransferManagerPresignedUrlDownloadIntegrationTest: Added parameterized progress tracking tests (multipart/non-multipart × range/no-range) asserting totalBytes, transferredBytes, and downloaded size correctness.

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@jencymaryjoseph jencymaryjoseph requested a review from a team as a code owner May 18, 2026 20:13
}

@Test
public void downloadFileWithPresignedUrl_success_shouldInvokeListener() throws Exception {
Copy link
Copy Markdown
Collaborator

@RanVaknin RanVaknin May 19, 2026

Choose a reason for hiding this comment

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

These new tests are using the mock S3CrtAsyncClient which is not a multipart client mock. I think these would pass regardless of the fix?

Are these related to the last PR? Why did we ship these separately?

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