aws / aws/aws-sdk-java-v2

ListObjectVersions response does not retain order of versions and delete markers

Open
#1,620 6 comments 8 reactions 0 assignees View on GitHub
1.x Parity feature-request p2
Dominant language
Java
Stars
2.6k
Forks
1k
Avg merge
2d 9h
Merged PRs (30d)
51

Description

The response to a [ListObjectVersions](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectVersions.html) request consists of a sequence of `Version` and `DeleteMarker` tags. The examples show that these are returned in (object key, version id) order with `Version`s and `DeleteMarker`s 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 `List`s: one for `Version`s and for `DeleteMarker`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 and `DeleteMarker`s are returned as two distinct lists.

## Possible Solution
Mimic the v1 object model.

## Steps to Reproduce (for bugs)
N/A

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.