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

supabase / supabase-flutter / 41839991989 / 10
94%
main: 94%

Build:
DEFAULT BRANCH: main
Ran 04 Nov 2026 01:44PM UTC
Files 16
Run time 0s
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 01:38PM UTC coverage: 89.076%. Remained the same
41839991989.10

push

github

web-flow
fix(realtime): time out a hung accessToken callback (#2124)

## Why

`_resolveAccessTokenAndFlush` awaited the `customAccessToken` callback
with no bound. A third-party callback that never completed left errored
channels unjoined and the send buffer unsent forever. On the heartbeat
path, the hung call also kept `_refreshingAccessTokenOnHeartbeat` set,
so no later heartbeat asked for a token again.

## What changes

Every `customAccessToken` call goes through one helper that bounds it by
the client's `timeout` (10 seconds by default) and fails with a
`TimeoutException`. The timeout is handled like any other callback
error:

- **Connect and reconnect:** the error surfaces as a `channelError`
status and on `onStatusChange`, the buffer stays unsent, and the
connection is closed so the reconnect backoff calls the callback again.
When `setAccessToken` has set a newer token while the call was pending,
the failure is only logged and the channels rejoin with the newer token,
as a superseded successful call already did.
- **Heartbeat:** the current token is kept and the next heartbeat asks
again.
- **`setAccessToken(null)`:** throws the `TimeoutException` instead of
never returning.
- **`httpSend`:** the timeout reaches the caller as an
`AccessTokenException` with the `TimeoutException` as `cause`, as other
callback errors already do.

A late result of a timed-out call is dropped by `Future.timeout`, and
the existing `_accessTokenResolution` generation guard still keeps an
older resolution from overwriting a newer token.

No throttle is added. The heartbeat already calls the callback at most
once per `heartbeatInterval`, and overlapping heartbeats already share
one call. No proactive refresh before `exp` either, because the auth
client already refreshes the session ahead of expiry.

No public API changes, so there is no `MIGRATION.md` section and no
`sdk-compliance.yaml` change.

## Tests

- `socket_test.dart`: a callback that never completes on connect times
o... (continued)

424 of 476 relevant lines covered (89.08%)

6.61 hits per line

Source Files on job supabase_flutter - 41839991989.10
  • Tree
  • List 16
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 41839991989
  • 290fdb0e on github
  • Prev Job for on main (#41836602004.6)
  • Next Job for on main (#42010838092.8)
  • 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