workers-types icon indicating copy to clipboard operation
workers-types copied to clipboard

R2PutOptions doesn't support conditional PUT

Open amodm opened this issue 3 years ago • 1 comments

Currently, R2PutOptions has no way of providing an If-Match condition, to allow conditional PUTs (write only if etag matches). Without this, how can we safeguard code against race conditions?

I checked that the S3 API for the same R2 bucket honours it. So your backend supports it, but not the API.

Is that deliberate? If yes, why? If not, can this be baked into the API?

amodm avatar Aug 04 '22 15:08 amodm

Conditionals on PutObject is a non-standard extension that only landed in the S3 API ~1 week ago - it's on the backlog to make it's way into the Workers bindings.

KianNH avatar Aug 04 '22 15:08 KianNH

This is supported now and represented in the current releases

KianNH avatar Oct 21 '22 13:10 KianNH

Awesome, thanks!

amodm avatar Oct 21 '22 13:10 amodm