• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / storage / 46396605657
89%

Build:
DEFAULT BRANCH: master
Ran 30 Nov 2026 10:06AM UTC
Jobs 2
Files 403
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

30 Nov 2026 10:04AM UTC coverage: 88.692% (+0.008%) from 88.684%
46396605657

push

github

web-flow
fix(s3): honor If-None-Match on PutObject and CompleteMultipartUpload (#1764)

## What kind of change does this PR introduce?

Bug fix. Closes #1635. Supersedes #1636.

## What is the current behavior?

S3 `PutObject` and `CompleteMultipartUpload` ignore `If-None-Match: *`.
The routes never read the header and the handler always uploads with
`isUpsert: true`, so a create-only write over an existing key returns
200 and replaces the object, and every one of several concurrent
create-only writes to a new key succeeds. Clients that take a lock with
`If-None-Match: *`, such as Terraform's S3 backend with `use_lockfile`,
can all hold the same lock.

## What is the new behavior?

`If-None-Match: *` makes the write create-only, which is exactly what a
non-upsert upload already does in the uploader: it rejects a live object
under the object lock and treats a current delete marker as no object.
So the handler maps the header onto `isUpsert: false` instead of adding
a second existence check, and reports the uploader's `KeyAlreadyExists`
as S3's `412 PreconditionFailed`.

- A create-only write to a key with no live object (or a current delete
marker) succeeds. Over a live object it fails with 412 and leaves the
object as it was.
- Of several concurrent create-only writes to a new key exactly one
succeeds; the rest get 412, as on S3 ("the first write operation to
finish succeeds").
- The RLS probe for a create-only write is the INSERT probe, as for a
REST upload without `x-upsert`.
- `If-None-Match` values other than `*` are rejected with `400
InvalidArgument` before anything is written. S3 accepts only `*` on
writes.
- `CompleteMultipartUpload` checks the condition before the backend
assembles the parts. A 412 there leaves the upload open, so the client
can retry without the condition or abort it.
- If another write takes the key while the backend is assembling the
parts, the completion still fails with 412 under the lock. By then the
backend has consumed the upl... (continued)

10283 of 12178 branches covered (84.44%)

Branch coverage included in aggregate %.

32 of 32 new or added lines in 3 files covered. (100.0%)

17639 of 19304 relevant lines covered (91.37%)

1282.16 hits per line

Jobs
ID Job ID Ran Files Coverage
1 unit - 46396605657.1 30 Nov 2026 10:06AM UTC 395
72.52
GitHub Action Run
2 rest-pg18 - 46396605657.2 30 Nov 2026 10:11AM UTC 376
68.62
GitHub Action Run
Source Files on build 46396605657
  • Tree
  • List 403
  • Changed 6
  • Source Changed 5
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #46396605657
  • 65aab97a on github
  • Prev Build on master (#46074532390)
  • Next Build on master (#46407341497)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc