New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ListObjectVersions response does not retain order of versions and delete markers #1620
Comments
@pepijnve I understand the issue you are raising. I don't have context on why this behavior was changed from V1 so I'll ask the team and update here when I have more info. This is a breaking change though. |
Discussed the issue and agreed this is not a good customer experience. So marking as a feature request. |
Is there a way to reliably get the order of versions and delete markers? I have written code to sort the versions and delete markers by lastModified and isLatest, but that does not seem entirely reliable. I do not believe I am able to replicate the sorting that you see in the AWS console since delete markers seem to (sometimes?) have the same lastModified as the versions. If there is no way to sort, then isn't this a bug in the API? |
…cf0353b7f Pull request: release <- staging/9030cfb6-c424-4995-8b8d-ed9cf0353b7f
It appears that the CLI and all of the v2 SDK implementations have this problem. Also note that delete markers and object versions may have the same timestamp, making it impossible to combine the lists to get an accurate version history. |
The response to a ListObjectVersions request consists of a sequence of
Version
andDeleteMarker
tags. The examples show that these are returned in (object key, version id) order withVersion
s andDeleteMarker
s interleaved.The v1 SDK makes this data accessible as a single
List
ofS3VersionSummary
objects. The latter can represent either aVersion
or aDeleteMarker
value. This way no information is lost regarding the ordering of the tags in the XML response.The v2 SDK on the other hand splits this into two
List
s: one forVersion
s and forDeleteMarker
s. As a consequence the relative ordering of the elements from the XML response is lost.Expected Behavior
The SDK provides an object model that provides a representation of the underlying XML data that matches the XML data as close as possible. Having to reconstruct the tag ordering in client code by grouping on object key and then sorting on timestamps while the response was already in exactly this order is unnecessary overhead.
Current Behavior
Version
s andDeleteMarker
s are returned as two distinct lists.Possible Solution
Mimic the v1 object model.
Steps to Reproduce (for bugs)
N/A
The text was updated successfully, but these errors were encountered: