You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When TransferManager.copy() performs a GetObjectMetadata request, it always requests the metadata for the latest object version (i.e., it doesn't pass in a versionId), even though it's possible for the CopyObjectRequest to specify a sourceVersionId. When constructing the GetObjectMetadataRequest, it should also pass in copyObjectRequest.getSourceVersionId().
There are several bugs that could be caused by not doing this if a non-current version of an object is being copied:
If you try to copy an object version when the object's current version has been deleted (i.e., the latest version is a delete marker), the copy will fail when it shouldn't.
If the size of the object version being copied differs from that of the current version, the transfer progress will be wrong because it will be using the wrong total size.
If the size of the object version being copied is greater than the multipart copy threshold size but the size of the current version is less than the threshold, multipart copy will not be used when it should be (or vice versa).
When performing a multipart copy, and the CopyObjectRequest didn't include any "newObjectMetadata" (or the newObjectMetadata contentType wasn't set), the contentType of the new object will be set to the content type of the current object version rather than the version being copied.
The text was updated successfully, but these errors were encountered:
Thanks for the response! I could certainly fix this myself because it's such a simple change, but I couldn't help but notice that the s3 module is one of the very few that doesn't even seem to have any tests. Are there really no tests for the S3 Java SDK? Should I just submit a PR for the fix itself (just a one-liner)?
Yes I apologize about the lack of tests. We have a large number of them internally but we don't currently publish them publicly, but we're working on it. Feel free to just submit the change to the TransferManager code and I can take care writing the tests and making sure everything is good.
When TransferManager.copy() performs a GetObjectMetadata request, it always requests the metadata for the latest object version (i.e., it doesn't pass in a versionId), even though it's possible for the CopyObjectRequest to specify a sourceVersionId. When constructing the GetObjectMetadataRequest, it should also pass in copyObjectRequest.getSourceVersionId().
There are several bugs that could be caused by not doing this if a non-current version of an object is being copied:
The text was updated successfully, but these errors were encountered: