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

supabase / supabase-flutter / 29031762837
87%

Build:
DEFAULT BRANCH: main
Ran 09 Jul 2026 04:02PM UTC
Jobs 9
Files 93
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

09 Jul 2026 04:00PM UTC coverage: 86.655% (+0.1%) from 86.537%
29031762837

push

github

web-flow
feat(auth): add async getSession() with on-demand refresh (#1563)

## Summary

Adds an async `getSession()` to `GoTrueClient`, alongside the existing
synchronous `currentSession` getter. It returns the current session and,
when the access token has expired, refreshes it on demand before
returning. Concurrent callers share a single refresh through the same
completer-based de-duplication used by `refreshSession`, so an expired
session's refresh token is only spent once (the Dart equivalent of
supabase-js's `_acquireLock`).

When a refresh fails but the access token is still within its real
validity window (it was only inside the 30s expiry margin), the
still-valid session is returned instead of surfacing the error,
mirroring supabase-js's proactive-preserve behavior. Otherwise the
`AuthException` propagates. Returns `null` when there is no session.

Nothing existing changes; `currentSession` stays.

## Outcome

Implemented.

- **Linear:** SDK-1274
- **supabase-js reference:** `GoTrueClient.getSession` / `__loadSession`
(default lockless path)
- **Compliance matrix:** `auth.session.get_session` → `implemented` (was
`partially_implemented`), registered `GoTrueClient.getSession`

## Tests

New `packages/gotrue/test/get_session_test.dart` covers: no session,
valid session (no request), on-demand refresh of an expired session,
concurrent de-duplication, throw when unrefreshable, and the still-valid
proactive-preserve fallback. All pass.

15 of 17 new or added lines in 3 files covered. (88.24%)

4565 of 5268 relevant lines covered (86.66%)

4.05 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
89.63
0.94% packages/supabase/lib/src/supabase_client.dart
Jobs
ID Job ID Ran Files Coverage
7 supabase - 29031762837.7 09 Jul 2026 04:03PM UTC 14
80.61
GitHub Action Run
8 supabase_flutter - 29031762837.8 09 Jul 2026 04:02PM UTC 10
79.31
GitHub Action Run
9 gotrue - 29031762837.9 09 Jul 2026 04:05PM UTC 28
86.02
GitHub Action Run
2 yet_another_json_isolate - 29030706929.2 09 Jul 2026 03:46PM UTC 1
77.78
GitHub Action Run
9 supabase_common - 29030706929.9 09 Jul 2026 03:46PM UTC 10
87.85
GitHub Action Run
1 postgrest - 29030706929.1 09 Jul 2026 03:48PM UTC 10
84.92
GitHub Action Run
3 functions_client - 29030706929.3 09 Jul 2026 03:46PM UTC 3
98.81
GitHub Action Run
6 realtime_client - 29030706929.6 09 Jul 2026 03:48PM UTC 11
89.44
GitHub Action Run
5 storage_client - 29030706929.5 09 Jul 2026 03:48PM UTC 6
93.71
GitHub Action Run
Source Files on build 29031762837
  • Tree
  • List 93
  • Changed 11
  • Source Changed 10
  • Coverage Changed 11
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #29031762837
  • 0b1d9b6b on github
  • Prev Build on main (#29030706929)
  • 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