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

supabase / supabase-flutter / 32354126909
89%

Build:
DEFAULT BRANCH: main
Ran 20 Aug 2026 09:31AM UTC
Jobs 10
Files 118
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

20 Aug 2026 09:29AM UTC coverage: 88.437% (-0.008%) from 88.445%
32354126909

push

github

web-flow
feat: resolve an access token per request on the standalone clients (#1742)

> [!NOTE]
> Stacked on #1739. Review that one first; the diff here is only the
last commit.

## Summary

Gives `PostgrestClient`, `SupabaseStorageClient` and `FunctionsClient`
an optional `accessToken` callback, resolved before every request and
sent as `Authorization: Bearer <token>`.

```dart
final functions = FunctionsClient(
  functionsUrl,
  {'apikey': anonKey},
  accessToken: () async => currentJwt,
);
```

## Why

#1739 removes `setAccessToken` from these three clients. Through
`SupabaseClient` nothing is lost, because `AuthHttpClient` already
resolves the session token per request. @Vinzent03 pointed out on that
PR that standalone users of these packages have no such wrapper, and are
left with a static constructor header or mutating the header map by
hand.

That is the gap the setters were filling, and filling badly: they pinned
a value that went stale, which is exactly why they became a footgun once
`AuthHttpClient` landed. A callback resolved per request covers the same
need without that failure mode.

This is the same shape supabase/supabase-swift#1233 gives the Swift
`FunctionsClient`.

## Behaviour

- Resolved before every request, and again for **every retry**, so a
token that rotates between attempts is picked up. Postgrest's retry loop
and storage's upload retry both go through it.
- Returning `null` sends no bearer token.
- A request that already carries an `Authorization` header keeps it, so
`invoke(headers: ...)`, `PostgrestBuilder.setHeader` and
`SupabaseStorageClient.setHeader` all still win over the callback.
- Passing both a constructor `Authorization` header and `accessToken`
asserts, since the header would win on every request and the callback
would never run.

Purely additive: the parameter is optional, and the assert can only fire
on a combination that was not expressible before this PR.

## Implementation

One `AccessTokenClient` in `supabase_commo... (continued)

12 of 14 new or added lines in 4 files covered. (85.71%)

5920 of 6694 relevant lines covered (88.44%)

4.34 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
71.43
packages/supabase_common/lib/src/access_token_client.dart
Jobs
ID Job ID Ran Files Coverage
2 supabase_functions - 32354126909.2 20 Aug 2026 09:31AM UTC 4
97.83
GitHub Action Run
3 supabase_realtime - 32354126909.3 20 Aug 2026 09:34AM UTC 13
90.27
GitHub Action Run
4 supabase_auth - 32354126909.4 20 Aug 2026 09:34AM UTC 30
90.69
GitHub Action Run
5 supabase_storage - 32354126909.5 20 Aug 2026 09:33AM UTC 9
97.31
GitHub Action Run
6 supabase_flutter - 32354126909.6 20 Aug 2026 09:32AM UTC 11
81.34
GitHub Action Run
7 supabase_common - 32354126909.7 20 Aug 2026 09:31AM UTC 19
88.35
GitHub Action Run
8 postgrest - 32354126909.8 20 Aug 2026 09:33AM UTC 11
85.2
GitHub Action Run
9 supabase - 32354126909.9 20 Aug 2026 09:34AM UTC 14
90.69
GitHub Action Run
10 iceberg - 32354126909.10 20 Aug 2026 09:31AM UTC 6
68.67
GitHub Action Run
2 yet_another_json_isolate - 32034091672.2 17 Aug 2026 01:16PM UTC 1
94.44
GitHub Action Run
Source Files on build 32354126909
  • Tree
  • List 118
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #32354126909
  • dd61782a on github
  • Prev Build on main (#32299689172)
  • Next Build on main (#32367207852)
  • 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