Skip to content
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

Open
pepijnve opened this issue Jan 28, 2020 · 4 comments
Labels
feature-request A feature should be added or improved. p2 This is a standard priority issue

Comments

@pepijnve
Copy link

The response to a ListObjectVersions request consists of a sequence of Version and DeleteMarker tags. The examples show that these are returned in (object key, version id) order with Versions and DeleteMarkers interleaved.

The v1 SDK makes this data accessible as a single List of S3VersionSummary objects. The latter can represent either a Version or a DeleteMarker 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 Lists: one for Versions and for DeleteMarkers. 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

Versions and DeleteMarkers are returned as two distinct lists.

Possible Solution

Mimic the v1 object model.

Steps to Reproduce (for bugs)

N/A

@debora-ito
Copy link
Member

@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.

@debora-ito debora-ito added investigating This issue is being investigated and/or work is in progress to resolve the issue. needs-discussion This issue/PR requires more discussion with community. labels Jan 30, 2020
@debora-ito
Copy link
Member

Discussed the issue and agreed this is not a good customer experience. So marking as a feature request.

@debora-ito debora-ito added feature-request A feature should be added or improved. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. needs-discussion This issue/PR requires more discussion with community. labels Feb 3, 2020
@mtruchard
Copy link

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?

image

aws-sdk-java-automation added a commit that referenced this issue Aug 19, 2021
…cf0353b7f

Pull request: release <- staging/9030cfb6-c424-4995-8b8d-ed9cf0353b7f
@josephtfrank
Copy link

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.

@yasminetalby yasminetalby added the p2 This is a standard priority issue label Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

5 participants