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

supabase / supabase-swift / 41051547105
96%

Build:
DEFAULT BRANCH: main
Ran 30 Oct 2026 12:02PM UTC
Jobs 1
Files 190
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

30 Oct 2026 11:55AM UTC coverage: 94.003% (+0.03%) from 93.975%
41051547105

push

github

web-flow
feat(supabase)!: retry a data request rejected for a stale token once, with the current token or after one refresh (#1634)

* feat(supabase)!: retry a 401 on data requests once with the current token or after one refresh

SupabaseClient now signs PostgREST, Storage, and Functions requests with an
internal AuthMiddleware. On a 401, a request signed with an older token is
sent again with the current one. A request signed with the current token
triggers one deduplicated refreshSession() and is sent again once. A failed
refresh, a second 401, a single-pass body, a per-call Authorization header,
and a request without a session return the response unchanged. Third-party
accessToken mode keeps AccessTokenMiddleware.

BREAKING CHANGE: a data request that gets a 401 is retried once, for every
HTTP method, after a refresh when needed.

Fixes SDK-2064

* test(supabase): cover the stale-token retry for Storage, another user, cancellation and Functions

Storage answers an expired JWT with 400, so the 401-only retry never fires
for it. A retry after another user signed in sends the request as that user.
Functions with a third-party provider that returns the new-format key now
sends that key as the bearer. These tests fail until the fix that follows.

* fix(supabase): retry Storage's expired-token 400 and never retry as another user

Storage answers an expired JWT with 400, the same status and body shape it
uses for an RLS denial. Each service now sets a StaleTokenRejection on the
middleware: PostgREST and Functions keep any 401, and Storage counts a 400
only when the token sent is past its exp claim. No body is read.

A retry now goes out only when the stored or refreshed session belongs to
the same user as the token sent, so a sign-in during the request cannot
turn a write into the new user's write.

Functions in third-party accessToken mode maps the provider's token through
functionsBearerToken again, so a provider that returns the new-format key
sends no bearer.... (continued)

93 of 93 new or added lines in 2 files covered. (100.0%)

5 existing lines in 2 files now uncovered.

13324 of 14174 relevant lines covered (94.0%)

588291.28 hits per line

Coverage Regressions

Lines Coverage ∆ File
3
83.88
-0.42% Sources/Supabase/SupabaseClient.swift
2
93.6
-0.35% Sources/Realtime/RealtimeClient.swift
Jobs
ID Job ID Ran Files Coverage
1 41051547105.1 30 Oct 2026 12:02PM UTC 190
94.0
GitHub Action Run
Source Files on build 41051547105
  • Tree
  • List 190
  • Changed 4
  • Source Changed 1
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #41051547105
  • 88c8444a on github
  • Prev Build on main (#41040687466)
  • Next Build on main (#41058365166)
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