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

supabase / supabase-flutter / 41832255342
94%

Build:
DEFAULT BRANCH: main
Ran 04 Nov 2026 12:48PM UTC
Jobs 12
Files 194
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

04 Nov 2026 12:46PM UTC coverage: 94.177% (+0.05%) from 94.131%
41832255342

push

github

web-flow
fix(supabase_auth): keep a refresh that overlaps updateUser (#2122)

## Summary

Every session write bumped the version in `_SessionState`, and
`_doRefresh` discarded its result when the version changed while the
request was in flight. `updateUser` writes the session too, so a refresh
that overlapped it was thrown away after the server had already rotated
the refresh token. The client kept the spent token, and the next refresh
failed or signed the user out.

The version now only changes when a write replaces the stored tokens. A
write that keeps the access and refresh token, such as a user update
(local or broadcast from another tab), leaves it alone. A sign-in, a
sign-out, another session of the same user, or another user still
changes it, so a refresh that overlaps one of those is still discarded.

When a user update lands during a refresh, the refreshed session keeps
the updated user, because the refresh response may have been produced
before the update. It keeps the refreshed user instead when that one has
a later `updated_at`, or belongs to another user. `refreshSession`
returns the session that was stored.

`_refreshForSignOut` carries the updated user the same way. The global
`signOut` now decides whether its session is still the stored one by
comparing tokens instead of object identity, so a user update during the
sign-out no longer leaves this device signed in with a revoked session.

Same fix as supabase/supabase-swift#1640.

## Tests

New `refresh_update_user_race_test.dart`, using `MockSupabaseHttpClient`
to hold the refresh and user update responses:

- A refresh that overlaps `updateUser` stores the rotated tokens with
the updated user and emits `userUpdated` then `tokenRefreshed`, and
`refreshSession` returns that session.
- An `updateUser` that completes after a refresh keeps the rotated
tokens.
- A refresh keeps its own user when it has a later `updated_at`, and
when it belongs to another user.
- A refresh that overlaps a sign-out, a ... (continued)

19 of 19 new or added lines in 1 file covered. (100.0%)

96 existing lines in 9 files now uncovered.

12663 of 13446 relevant lines covered (94.18%)

6.9 hits per line

Coverage Regressions

Lines Coverage ∆ File
50
93.29
0.14% packages/supabase_auth/lib/src/auth_client.dart
14
97.17
0.22% packages/supabase_realtime/lib/src/realtime_channel.dart
10
94.92
0.3% packages/supabase_test/lib/src/mock_realtime_transport.dart
9
96.05
-0.12% packages/supabase_realtime/lib/src/realtime_client.dart
5
95.54
0.08% packages/supabase_flutter/lib/src/supabase_auth.dart
4
84.0
0.0% packages/supabase_auth/lib/src/types/auth_response.dart
2
98.04
0.02% packages/supabase_auth/lib/src/fetch.dart
1
92.86
0.0% packages/supabase_flutter/lib/src/flutter_auth_client_options.dart
1
92.31
0.0% packages/supabase_test/lib/src/session_fixture.dart
Jobs
ID Job ID Ran Files Coverage
3 iceberg - 41832255342.3 04 Nov 2026 12:48PM UTC 7
99.72
GitHub Action Run
4 postgrest - 41832255342.4 04 Nov 2026 12:51PM UTC 30
92.88
GitHub Action Run
5 supabase_functions - 41832255342.5 04 Nov 2026 12:49PM UTC 4
94.01
GitHub Action Run
6 supabase_typegen - 41832255342.6 04 Nov 2026 12:50PM UTC 6
94.44
GitHub Action Run
7 supabase_flutter - 41832255342.7 04 Nov 2026 12:49PM UTC 16
89.08
GitHub Action Run
8 supabase - 41832255342.8 04 Nov 2026 12:52PM UTC 21
94.52
GitHub Action Run
9 supabase_auth - 41832255342.9 04 Nov 2026 12:53PM UTC 34
94.3
GitHub Action Run
10 supabase_storage - 41832255342.10 04 Nov 2026 12:51PM UTC 13
95.96
GitHub Action Run
11 supabase_realtime - 41832255342.11 04 Nov 2026 12:51PM UTC 15
92.27
GitHub Action Run
12 supabase_test - 41832255342.12 04 Nov 2026 12:49PM UTC 9
93.73
GitHub Action Run
2 yet_another_json_isolate - 41623445554.2 03 Nov 2026 10:58AM UTC 2
98.65
GitHub Action Run
4 supabase_common - 41623445554.4 03 Nov 2026 10:58AM UTC 37
94.39
GitHub Action Run
Source Files on build 41832255342
  • Tree
  • List 194
  • Changed 14
  • Source Changed 14
  • Coverage Changed 13
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #41832255342
  • 81cff845 on github
  • Prev Build on main (#41831877457)
  • Next Build on main (#41836602004)
  • 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