aws / aws-sdk-js

AWS SDK for JavaScript in the browser and Node.js
https://aws.amazon.com/developer/language/javascript/
Apache License 2.0
7.59k stars 1.55k forks source link

Successful s3.deleteObject call returns empty results #1197

Closed ffxsam closed 7 years ago

ffxsam commented 7 years ago

Using aws-sdk 2.6.9. When I execute a successful deletion request:

s3.deleteObject({
  Bucket: 'my-bucket',
  Key: 'some/key/file.txt',
}, (error, result) => {
  console.log(error, result);
});

error is null and result is {}. I'm pretty sure this is unexpected behavior.

monken commented 7 years ago

No it isn't.

From http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectDELETE.html

This implementation of the operation does not return response elements.

ffxsam commented 7 years ago

Then what about this?

http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#deleteObject-property

Quote:

Parameters:

monken commented 7 years ago

That seems to only apply to DELETEs in versioned buckets.

chrisradek commented 7 years ago

@ffxsam @monken is correct, those fields on the data object are not guaranteed to be there. DeleteMarker and VersionID should be there when working with versioned objects, and RequestCharged should be there is the object is configured such that requesters get charged for downloads.

ffxsam commented 7 years ago

Good to know - thanks for clarifying!

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.