Closed schmich closed 11 years ago
Sorry for the delay - I'm picking this up now.
I'm submitting a change that updates the documentation and marks ObjectMetadata#[]= as deprecated. The added documentation should make the risks of the []= function especially clear.
Perfect, thanks a bunch, Alex. The usage is much clearer with your updates.
We were bitten pretty badly by the issue mentioned in #180, and it took us some time to figure out what was happening.
Our code was very roughly this:
I will grant that AWS veterans will know that updating an object's metadata uses CopyObject under the covers, but new users coding diligently from the docs will most likely miss this subtle point.
A few ideas for helping users avoid this pitfall:
ObjectMetadata#[]=(name, value)
to mention the caveat of not preserving certain attributes (:server_side_encryption
,:reduced_redundancy
, ...). You could even copy the note fromS3Object#copy_from
.S3Object#copy_from
manually.S3Object
orObjectMetadata
to do an attribute-preserving metadata update. This is a bit more invasive and, as #180 mentioned, hints at a leaky abstraction.I'm happy to make the doc changes myself and submit a pull request if help is needed.
Regards, Chris