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

supabase / supabase-flutter / 28278469437
86%

Build:
DEFAULT BRANCH: main
Ran 27 Jun 2026 04:24AM UTC
Jobs 8
Files 80
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

27 Jun 2026 04:23AM UTC coverage: 85.64%. Remained the same
28278469437

push

github

web-flow
feat(gotrue): surface the sign-out reason on the signedOut event (#1453)

## What

Adds `AuthState.signOutReason`, a typed `SignOutReason` populated on the
`signedOut` event so listeners can tell **why** the user was signed out:

- `userInitiated` for an explicit `signOut()`.
- `sessionExpired` when the refresh token was rejected (invalid or
expired) and the session was removed.
- `sessionMissing` when a stored session could not be recovered because
it was missing required data.

It is `null` for every event other than `signedOut`, and also `null` for
`signedOut` events received from another tab via `web.BroadcastChannel`.

## Why

Follow-up to #1450, which stops `recoverSession` from double-reporting
an expected sign-out as an uncaught stream error. The remaining concern
was that a pure `onAuthStateChange` listener then sees `signedOut`
without knowing why the user was signed out, removing the ability to
handle it differently or notify the user.

This restores that capability through the event itself, rather than
through an error that only reaches listeners with an `onError` handler:

```dart
supabase.auth.onAuthStateChange.listen((state) {
  if (state.event == AuthChangeEvent.signedOut &&
      state.signOutReason != null &&
      state.signOutReason != SignOutReason.userInitiated) {
    // involuntary sign out (e.g. expired session) -> show a message
  }
});
```

## How

- New `SignOutReason` enum (`userInitiated`, `sessionExpired`,
`sessionMissing`), exported from `gotrue.dart`.
- `AuthState` gains a nullable `signOutReason` field, threaded through
`notifyAllSubscribers`.
- `signOut()` now delegates to a private `_signOut({scope, reason})` so
the public API is unchanged while internal callers can pass a reason.
- `recoverSession` and `setInitialSession` sign out with the appropriate
reason and now throw `AuthException`s tagged with
`ErrorCode.sessionMissing` / `ErrorCode.sessionExpired` (new error
codes).
- The non-retryable refresh failure path s... (continued)

20 of 24 new or added lines in 2 files covered. (83.33%)

112 existing lines in 2 files now uncovered.

4121 of 4812 relevant lines covered (85.64%)

3.69 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
73.26
0.0% packages/gotrue/lib/src/gotrue_client.dart

Coverage Regressions

Lines Coverage ∆ File
110
73.26
0.0% packages/gotrue/lib/src/gotrue_client.dart
2
0.0
0.0% packages/gotrue/lib/src/types/error_code.dart
Jobs
ID Job ID Ran Files Coverage
7 supabase - 28278469437.7 27 Jun 2026 04:24AM UTC 15
81.99
GitHub Action Run
8 supabase_flutter - 28278469437.8 27 Jun 2026 04:25AM UTC 11
77.99
GitHub Action Run
6 realtime_client - 28254051980.6 26 Jun 2026 05:25PM UTC 11
88.56
GitHub Action Run
4 functions_client - 27986095786.4 22 Jun 2026 09:45PM UTC 2
97.14
GitHub Action Run
7 yet_another_json_isolate - 27986095786.7 22 Jun 2026 09:45PM UTC 1
79.03
GitHub Action Run
6 postgrest - 28231764812.6 26 Jun 2026 10:17AM UTC 9
84.31
GitHub Action Run
8 gotrue - 28245085940.8 26 Jun 2026 02:42PM UTC 26
84.31
GitHub Action Run
5 storage_client - 28160249676.5 25 Jun 2026 09:26AM UTC 5
92.97
GitHub Action Run
Source Files on build 28278469437
  • Tree
  • List 80
  • Changed 4
  • Source Changed 4
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28278469437
  • a182b204 on github
  • Prev Build on main (#28254051980)
  • 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