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

supabase / supabase-flutter / 33181427034
89%

Build:
DEFAULT BRANCH: main
Ran 28 Aug 2026 02:42PM UTC
Jobs 10
Files 120
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

28 Aug 2026 02:41PM UTC coverage: 88.591% (+0.04%) from 88.554%
33181427034

push

github

web-flow
fix(postgrest): enforce maybeSingle() client-side for all request methods (#1779)

## What kind of change does this PR introduce?

Bug fix.

## What is the current behavior?

`maybeSingle()` only avoids the `application/vnd.pgrst.object+json`
Accept header for GET requests. For every other method, for example
`.insert(...).select().maybeSingle()` or an update, the header is still
sent, so a request matching zero rows makes PostgREST answer with a real
406 that shows up in the project's API logs. The client then swallows
that 406 by string-matching `Results contain 0 rows` in the error
details.

This is the remaining half of #560, which the previous workaround
explicitly called out as unfixed:


https://github.com/supabase/supabase-flutter/blob/effc37d52/packages/postgrest/lib/src/postgrest_transform_builder.dart#L209-L210

## What is the new behavior?

`maybeSingle()` no longer overrides the Accept header at all. The result
is fetched as a plain JSON list for every request method and the
at-most-one-row constraint is enforced client-side: one row resolves to
that row, zero rows resolve to `null`, and more than one row throws a
406 `PostgrestApiException` with error code `PGRST116`, mirroring
PostgREST's own error. No 406 ever reaches the server, so nothing
pollutes the API logs.

This matches how supabase-js fixed the same problem
(supabase/postgrest-js#361), and it allows removing the brittle
`_handleMaybeSingleError` fallback that string-matched error details.

The synthesized multiple-rows error now also carries `errorCode:
'PGRST116'`, which the previous client-side error left unset.

## Additional context

The mock tests in `maybe_single_test.dart` simulated the old
server-generated 406 responses and were rewritten to cover the new
behavior: no Accept override for reads or writes, zero rows with
`count()` resolving to `null` data and count 0, a client-side 406 on a
multi-row write, and a genuine server error surfaci... (continued)

1 of 1 new or added line in 1 file covered. (100.0%)

1 existing line in 1 file now uncovered.

6041 of 6819 relevant lines covered (88.59%)

4.58 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
81.06
0.38% packages/postgrest/lib/src/postgrest_builder.dart
Jobs
ID Job ID Ran Files Coverage
3 supabase_functions - 33181427034.3 28 Aug 2026 02:42PM UTC 4
93.81
GitHub Action Run
4 supabase_realtime - 33181427034.4 28 Aug 2026 02:45PM UTC 13
90.27
GitHub Action Run
5 supabase_storage - 33181427034.5 28 Aug 2026 02:45PM UTC 9
97.35
GitHub Action Run
6 supabase_flutter - 33181427034.6 28 Aug 2026 02:43PM UTC 11
82.22
GitHub Action Run
7 supabase_auth - 33181427034.7 28 Aug 2026 02:45PM UTC 30
90.62
GitHub Action Run
8 iceberg - 33181427034.8 28 Aug 2026 02:42PM UTC 6
68.52
GitHub Action Run
9 supabase - 33181427034.9 28 Aug 2026 02:46PM UTC 14
93.49
GitHub Action Run
10 postgrest - 33181427034.10 28 Aug 2026 02:45PM UTC 11
84.75
GitHub Action Run
5 yet_another_json_isolate - 32956931006.5 26 Aug 2026 10:12AM UTC 1
98.44
GitHub Action Run
9 supabase_common - 32951661159.9 26 Aug 2026 09:12AM UTC 21
86.96
GitHub Action Run
Source Files on build 33181427034
  • Tree
  • List 120
  • Changed 13
  • Source Changed 12
  • Coverage Changed 13
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #33181427034
  • c360849d on github
  • Prev Build on main (#32982098636)
  • Next Build on main (#33188560437)
  • 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