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

supabase / supabase-flutter / 29031762837 / 7
87%
main: 87%

Build:
DEFAULT BRANCH: main
Ran 09 Jul 2026 04:06PM UTC
Files 14
Run time 2s
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: 80.615% (+0.3%) from 80.328%
29031762837.7

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.

341 of 423 relevant lines covered (80.61%)

2.1 hits per line

Source Files on job supabase - 29031762837.7
  • Tree
  • List 14
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 29031762837
  • 0b1d9b6b on github
  • Prev Job for on main (#29030706929.8)
  • 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