-
Notifications
You must be signed in to change notification settings - Fork 50
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 not returning all existing versions #1220
Comments
Thanks for the report, I was able to recreate this. It seems related to the use of xmlFlattened on the model: "Versions": {
"target": "com.amazonaws.s3#ObjectVersionList",
"traits": {
"smithy.api#documentation": "<p>Container for version information.</p>",
"smithy.api#xmlFlattened": {},
"smithy.api#xmlName": "Version"
}
},
"DeleteMarkers": {
"target": "com.amazonaws.s3#DeleteMarkers",
"traits": {
"smithy.api#documentation": "<p>Container for an object that is a delete marker.</p>",
"smithy.api#xmlFlattened": {},
"smithy.api#xmlName": "DeleteMarker"
}
}, The response I'm seeing has version and delete marker elements intermixed: <ListVersionsResult ...>
<DeleteMarker> ... </DeleteMarker>
<Version> ... </Version>
<DeleteMarker> ... </DeleteMarker>
<Version> ... </Version>
....
</ListVersionsResult> This is of course valid XML but wasn't expected by the XML deserializer for the given trait. We'll have to investigate how to best rectify this in the short term and in the longer term clarify with Smithy team on whether this is expected service behavior. |
Hello @aajtodd. Do you have any updates from the Smithy team? I don't think this is expected service behavior since this is a different behavior from the one present in the Java SDK. |
It's a bug in the SDK. I'm working on a fix. |
|
Fix for this has been merged to main, should be available in a release either today or tomorrow. |
Thank you for your help @aajtodd 🦾 |
Describe the bug
After calling
deleteObject
for a file without specifying a version (thus creating a 'deleted version'), subsequent calls tolistObjectVersions
fail to display versions of files with a lower alphabetical order. This inconsistency poses a challenge in accurately managing file versions.Expected behavior
When I call
listObjectVersions
I expect to see all versions of all objects except for deleted versions.Current behavior
When I call
listObjectVersions
some versions are not returned, on objects with no deleted versionsSteps to Reproduce
Example 1:
file-1,
file-2
, andfile-3
on S3.file-2
using thedeleteObject
method, specifying only the bucket and the filename (no version is specified).listObjectVersions
, we observe that it returns versions forfile-2
andfile-3
exclusively. It's noteworthy that the alphabetical order of filenames is crucial; hadfile-3
been the one deleted,listObjectVersions
would solely present versions forfile-3
.Example 2:
file-3
andfile-2
.file-3
using thedeleteObject
method, specifying only the bucket and the filename (no version is specified).file-1
andfile-4
on S3.listObjectVersions
, we notice that it exclusively returns versions forfile-3
andfile-4
, despite the fact thatfile-1
was generated subsequent to the invocation ofdeleteObject
forfile-3
.Possible Solution
No response
Context
Migration from Java to Kotlin SDK.
I've encountered an unusual bug while attempting to delete multiple files from my MinIO instance, which we use in our local environment as our S3 instance. To delete all objects along with their versions, I utilize the
listObjectVersions
method to gather information and subsequently invoke thedeleteObject
function with the respective file key and version.AWS Kotlin SDK version used
1.0.54
Platform (JVM/JS/Native)
JVM
Operating System and version
macOS 14.3.1 (Sonoma)
The text was updated successfully, but these errors were encountered: