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

supabase / supabase-flutter / 28603435609
86%

Build:
DEFAULT BRANCH: main
Ran 02 Jul 2026 03:54PM UTC
Jobs 8
Files 81
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

02 Jul 2026 03:53PM UTC coverage: 86.011%. Remained the same
28603435609

push

github

web-flow
fix(postgrest): override limit and offset instead of appending duplicates (#1512)

## What

`limit()` and `range()` built their query params with
`appendSearchParams`, which accumulates repeated keys. Because `limit`
and `offset` are single-valued in PostgREST, chaining or re-applying
them emitted duplicate, conflicting params:

```dart
from('t').select().limit(5).range(0, 9); // select=*&limit=5&limit=10&offset=0
from('t').select().limit(1).limit(2);     // limit=1&limit=2
from('t').select().range(0, 9).range(10, 19); // offset=0&offset=10&limit=10&limit=10
```

This overrides those keys so the last call wins.

## Why

`limit`/`range` used `appendSearchParams`, but `select`
(`postgrest_transform_builder.dart:46`) and `order` (`:88`) in the same
file already use `overrideSearchParams` for exactly this reason.
postgrest-js also uses `searchParams.set(...)` for `limit` and `range`.
Emitting two `limit`/`offset` values is ambiguous and diverges from
both.

Fix: give `overrideSearchParams` the same optional `[Uri? url]`
parameter that `appendSearchParams` already has, then use it for `limit`
(single key) and `range` (both `offset` and `limit`).

## Not a breaking change

A single `limit()`/`range()` call produces the same query string as
before — only the previously-duplicated case changes (the last value now
wins, which is the documented intent). `overrideSearchParams` gains an
optional parameter, so existing callers are unaffected.

## Tests

Added `packages/postgrest/test/limit_range_test.dart` (URL-capturing
mock): `.limit(1).limit(2)` → `limit=2`; `.limit(5).range(0,9)` → single
`limit=10` + `offset=0`; `.range(0,9).range(10,19)` → single
`offset=10`/`limit=10`; and the `referencedTable` variant stays scoped
and single-valued. All fail on the current code (e.g. `Actual: ['1',
'2']`) and pass with the fix. `dart format` and `dart analyze
--fatal-warnings` are clean.

---------

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>

6 of 6 new or added lines in 2 files covered. (100.0%)

4218 of 4904 relevant lines covered (86.01%)

4.0 hits per line

Jobs
ID Job ID Ran Files Coverage
6 supabase_flutter - 28603435609.6 02 Jul 2026 03:55PM UTC 11
79.57
GitHub Action Run
7 postgrest - 28603435609.7 02 Jul 2026 03:56PM UTC 9
84.31
GitHub Action Run
8 supabase - 28603435609.8 02 Jul 2026 03:54PM UTC 15
81.8
GitHub Action Run
8 gotrue - 28536394514.8 01 Jul 2026 05:43PM UTC 27
84.74
GitHub Action Run
3 yet_another_json_isolate - 28433368938.3 30 Jun 2026 09:12AM UTC 1
79.03
GitHub Action Run
8 realtime_client - 28599569004.8 02 Jul 2026 02:57PM UTC 11
89.15
GitHub Action Run
7 functions_client - 28444889808.7 30 Jun 2026 12:39PM UTC 2
98.57
GitHub Action Run
8 storage_client - 28533236058.8 01 Jul 2026 04:46PM UTC 5
92.98
GitHub Action Run
Source Files on build 28603435609
  • Tree
  • List 81
  • Changed 3
  • Source Changed 3
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28603435609
  • f1c80d60 on github
  • Prev Build on main (#28599569004)
  • Next Build on main (#28613300326)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc