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

supabase / supabase-py / 42004749490
98%

Build:
DEFAULT BRANCH: main
Ran 05 Nov 2026 09:43AM UTC
Jobs 42
Files 120
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

05 Nov 2026 09:43AM UTC coverage: 95.158% (+0.3%) from 94.886%
42004749490

push

github

web-flow
fix(supabase): keep the session token on every auth event that has one (#1989)

Every auth event that carries a session now sets `Authorization` to that
session's access token. Before, only `SIGNED_IN`, `TOKEN_REFRESHED` and
`SIGNED_OUT` did. Any other event, such as `USER_UPDATED`,
`PASSWORD_RECOVERY` or `MFA_CHALLENGE_VERIFIED`, reset `Authorization`
to the project key. That downgraded the user to anon, and the aal2 token
from an MFA verify was never used. This ports the v2 fix from #1856 to
v3.

## Changes

- `_listen_to_auth_events` (async and sync) uses `session.access_token`
whenever the event has a session, and the project key otherwise.
- The sync client always drops its cached postgrest, storage and
functions clients on an auth event, so they pick up the new header.
- `AsyncClient.auth` was a property that built a new auth client on
every access. The listener was subscribed on a throwaway instance, so it
never fired on the async client. The auth client is now built once in
`__init__`, as on the sync client. This fixes SDK-2660, which this
ticket depends on.
- `create()` and the listener now share one `_set_access_token` helper.
A session restored from storage in `create()` now also reaches the auth
client's headers (and the async realtime token), not only
`options.headers`.

## Tests

New tests in `tests/_async/test_client.py` and
`tests/_sync/test_client.py` emit events through the real auth client's
subscribers, and check that postgrest, storage, functions, auth and
(async) realtime all use the session token for every session event, and
the project key after `SIGNED_OUT`. Another test checks that `create()`
applies a stored session token everywhere. They fail on `main` and pass
with this change.

Closes SDK-2812
Closes SDK-2660

9237 of 9707 relevant lines covered (95.16%)

5.8 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
92.31
14.74% src/supabase/_async/client.py
1
93.52
7.28% src/supabase/_sync/client.py
Jobs
ID Job ID Ran Files Coverage
1 auth-py3.12-highest - 42004749490.1 05 Nov 2026 09:44AM UTC 36
91.55
GitHub Action Run
2 storage-py3.11-lowest-direct - 42004749490.2 05 Nov 2026 09:45AM UTC 22
93.18
GitHub Action Run
3 storage-py3.11-highest - 42004749490.3 05 Nov 2026 09:45AM UTC 22
93.18
GitHub Action Run
4 utils-py3.15-highest - 42004749490.4 05 Nov 2026 09:43AM UTC 17
99.34
GitHub Action Run
5 functions-py3.11-highest - 42004749490.5 05 Nov 2026 09:44AM UTC 14
97.48
GitHub Action Run
6 realtime-py3.11-highest - 42004749490.6 05 Nov 2026 09:45AM UTC 8
95.88
GitHub Action Run
7 realtime-py3.11-lowest-direct - 42004749490.7 05 Nov 2026 09:45AM UTC 8
95.88
GitHub Action Run
8 realtime-py3.15-highest - 42004749490.8 05 Nov 2026 09:45AM UTC 8
95.17
GitHub Action Run
9 utils-py3.11-highest - 42004749490.9 05 Nov 2026 09:43AM UTC 17
99.36
GitHub Action Run
10 storage-py3.14-highest - 42004749490.10 05 Nov 2026 09:45AM UTC 22
93.16
GitHub Action Run
11 supabase-py3.12-highest - 42004749490.11 05 Nov 2026 09:44AM UTC 22
97.77
GitHub Action Run
12 postgrest-py3.13-highest - 42004749490.12 05 Nov 2026 09:45AM UTC 24
97.51
GitHub Action Run
13 postgrest-py3.11-highest - 42004749490.13 05 Nov 2026 09:45AM UTC 24
97.51
GitHub Action Run
14 functions-py3.15-highest - 42004749490.14 05 Nov 2026 09:44AM UTC 14
97.48
GitHub Action Run
15 postgrest-py3.15-highest - 42004749490.15 05 Nov 2026 09:45AM UTC 24
97.5
GitHub Action Run
16 postgrest-py3.12-highest - 42004749490.16 05 Nov 2026 09:45AM UTC 24
97.51
GitHub Action Run
17 utils-py3.14-highest - 42004749490.17 05 Nov 2026 09:43AM UTC 17
99.34
GitHub Action Run
18 supabase-py3.13-highest - 42004749490.18 05 Nov 2026 09:44AM UTC 22
97.77
GitHub Action Run
19 auth-py3.15-highest - 42004749490.19 05 Nov 2026 09:44AM UTC 36
91.52
GitHub Action Run
20 realtime-py3.12-highest - 42004749490.20 05 Nov 2026 09:45AM UTC 8
95.88
GitHub Action Run
21 utils-py3.13-highest - 42004749490.21 05 Nov 2026 09:44AM UTC 17
99.36
GitHub Action Run
22 auth-py3.14-highest - 42004749490.22 05 Nov 2026 09:44AM UTC 36
91.52
GitHub Action Run
23 functions-py3.14-highest - 42004749490.23 05 Nov 2026 09:43AM UTC 14
97.48
GitHub Action Run
24 functions-py3.11-lowest-direct - 42004749490.24 05 Nov 2026 09:44AM UTC 14
97.48
GitHub Action Run
25 storage-py3.15-highest - 42004749490.25 05 Nov 2026 09:46AM UTC 22
93.16
GitHub Action Run
26 auth-py3.11-lowest-direct - 42004749490.26 05 Nov 2026 09:44AM UTC 36
91.55
GitHub Action Run
27 storage-py3.13-highest - 42004749490.27 05 Nov 2026 09:45AM UTC 22
93.18
GitHub Action Run
28 realtime-py3.13-highest - 42004749490.28 05 Nov 2026 09:45AM UTC 8
95.88
GitHub Action Run
29 postgrest-py3.14-highest - 42004749490.29 05 Nov 2026 09:45AM UTC 24
97.5
GitHub Action Run
30 storage-py3.12-highest - 42004749490.30 05 Nov 2026 09:45AM UTC 22
93.18
GitHub Action Run
31 utils-py3.11-lowest-direct - 42004749490.31 05 Nov 2026 09:44AM UTC 17
99.36
GitHub Action Run
32 realtime-py3.14-highest - 42004749490.32 05 Nov 2026 09:45AM UTC 8
95.34
GitHub Action Run
33 supabase-py3.15-highest - 42004749490.33 05 Nov 2026 09:45AM UTC 22
97.76
GitHub Action Run
34 supabase-py3.11-lowest-direct - 42004749490.34 05 Nov 2026 09:44AM UTC 22
97.77
GitHub Action Run
35 auth-py3.13-highest - 42004749490.35 05 Nov 2026 09:44AM UTC 36
91.55
GitHub Action Run
36 functions-py3.13-highest - 42004749490.36 05 Nov 2026 09:43AM UTC 14
97.48
GitHub Action Run
37 supabase-py3.14-highest - 42004749490.37 05 Nov 2026 09:43AM UTC 22
97.76
GitHub Action Run
38 postgrest-py3.11-lowest-direct - 42004749490.38 05 Nov 2026 09:45AM UTC 24
97.51
GitHub Action Run
39 functions-py3.12-highest - 42004749490.39 05 Nov 2026 09:44AM UTC 14
97.48
GitHub Action Run
40 supabase-py3.11-highest - 42004749490.40 05 Nov 2026 09:44AM UTC 22
97.77
GitHub Action Run
41 utils-py3.12-highest - 42004749490.41 05 Nov 2026 09:43AM UTC 17
99.36
GitHub Action Run
42 auth-py3.11-highest - 42004749490.42 05 Nov 2026 09:44AM UTC 36
91.55
GitHub Action Run
Source Files on build 42004749490
  • Tree
  • List 120
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #42004749490
  • 0c07c586 on github
  • Prev Build on main (#41997067215)
  • Next Build on main (#42004781188)
  • 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