Closed JanDintel closed 7 years ago
We're providing what the service response is providing. It appears that :delete_marker
is only ever populated for versioned objects. For example, in a versioned bucket:
s3.put_object(bucket: bucket, key: "test", body: "test")
resp = s3.delete_object(bucket: bucket, key: "test")
resp.delete_marker #=> true
That said, nil
is a falsy object, so you should be able to treat it as a boolean.
@awood45 I'm sorry, didn't catch that it was only for a versioned object. Thanks for your answer!
In case anyone finds this thread from experiencing this issue. I found an interesting fix. If you turn on versioning on the bucket and then turn it back off then the response for delete_marker will return a "true" opposed to a "nil".
I experienced this as I was switching between buckets and had apparently turned on versioning on one bucket and turned it back off while never enabling it on the other bucket.
Problem When using
Aws::S3::Client#delete_object
the#delete_marker
returnsnil
, instead oftrue
orfalse
.Description According to the AWS S3 DELETE Object documentation the delete marker should always return either
true
orfalse
. However in the Ruby SDK the delete marker returnsnil
.Test case You can reproduce the problem with the code below.