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

supabase / supabase-flutter / 36114631192
94%

Build:
DEFAULT BRANCH: main
Ran 25 Sep 2026 08:46AM UTC
Jobs 11
Files 171
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

25 Sep 2026 08:45AM UTC coverage: 91.135% (+0.001%) from 91.134%
36114631192

push

github

web-flow
fix(postgrest): keep a client-level Prefer header on writes (#1886)

## What

`insert()`, `update()` and `delete()` dropped the `Prefer` key from the
request headers, and `upsert()` overwrote it, so a `Prefer` set on the
client never reached a write. Every site that contributes a preference
now merges into the header by key.

## Why

A preference set once on the client is sent on reads and on RPC, but not
on writes:

```dart
final postgrest = PostgrestClient(url, headers: {'Prefer': 'tx=rollback'});

await postgrest.from('users').select();                 // Prefer: tx=rollback
await postgrest.rpc('f');                               // Prefer: tx=rollback
await postgrest.from('users').insert({'a': 1});         // Prefer absent
await postgrest.from('users').update({'a': 1}).eq(...); // Prefer absent
await postgrest.from('users').delete().eq(...);         // Prefer absent
await postgrest.from('users').upsert({'id': 1});        // Prefer: resolution=merge-duplicates
```

`tx=rollback` is the clearest case, because the writes are exactly the
requests the caller wanted rolled back, but the same applies to
`timezone=`, `handling=` and `max-affected=`.

The removal dates from the fix for the malformed `Prefer:
,return=representation` header. The empty seed was the actual cause of
that, and it is handled at every append site, so the key no longer has
to be deleted to keep the header clean. The twelve existing tests that
assert a clean or absent `Prefer` still pass untouched.

## Merging by key

PostgREST uses the first occurrence when a preference appears twice
(`ApiRequest/Preferences.hs`: `fromHeaders True [("Prefer", "tx=commit,
tx=rollback")]` gives `Just Commit`), so keeping the client's header is
only safe if the call's own preferences replace the ones they conflict
with. Appending alone would let the client's value win.

`maxAffected()` is the case that matters, because it is the guard on a
destructive write. It previously started from an empty header ... (continued)

28 of 29 new or added lines in 3 files covered. (96.55%)

8697 of 9543 relevant lines covered (91.13%)

4.92 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
90.48
-0.15% packages/postgrest/lib/src/postgrest_query_builder.dart
Jobs
ID Job ID Ran Files Coverage
3 supabase_flutter - 36114631192.3 25 Sep 2026 08:47AM UTC 14
78.5
GitHub Action Run
4 supabase_realtime - 36114631192.4 25 Sep 2026 08:49AM UTC 13
90.66
GitHub Action Run
5 supabase_auth - 36114631192.5 25 Sep 2026 08:50AM UTC 32
92.06
GitHub Action Run
6 iceberg - 36114631192.6 25 Sep 2026 08:46AM UTC 6
68.52
GitHub Action Run
7 supabase - 36114631192.7 25 Sep 2026 08:50AM UTC 18
93.71
GitHub Action Run
8 supabase_typegen - 36114631192.8 25 Sep 2026 08:49AM UTC 24
95.2
GitHub Action Run
9 supabase_functions - 36114631192.9 25 Sep 2026 08:46AM UTC 4
96.0
GitHub Action Run
10 postgrest - 36114631192.10 25 Sep 2026 08:49AM UTC 28
94.11
GitHub Action Run
11 supabase_storage - 36114631192.11 25 Sep 2026 08:49AM UTC 9
97.83
GitHub Action Run
2 yet_another_json_isolate - 35608843571.2 21 Sep 2026 01:58PM UTC 1
98.44
GitHub Action Run
8 supabase_common - 35998092270.8 24 Sep 2026 12:18PM UTC 22
87.5
GitHub Action Run
Source Files on build 36114631192
  • Tree
  • List 171
  • Changed 5
  • Source Changed 5
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #36114631192
  • 7b2027ae on github
  • Prev Build on main (#35998092270)
  • Next Build on main (#36168016912)
  • Delete
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