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

supabase / supabase-flutter / 27970805559
85%

Build:
DEFAULT BRANCH: main
Ran 22 Jun 2026 05:19PM 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

22 Jun 2026 05:17PM UTC coverage: 85.189% (-0.07%) from 85.26%
27970805559

push

github

web-flow
fix(realtime_client): detect dropped connections on iOS via WebSocket ping (#1451)

## What

Enable `pingInterval` on the native (`dart:io`) WebSocket so dropped
connections are detected consistently across platforms.

## Why

Fixes #1071. When the internet drops, Android emits a
`RealtimeSubscribeException` (close code 1002) but iOS emits nothing,
leaving the stream silently stale.

**Root cause:** `createWebSocketClient` created the native WebSocket
without a `pingInterval`, so a *silently* dropped connection was never
detected at the socket layer:

- On **Android**, the OS surfaces the dead TCP connection promptly (RST
→ close code 1002), so `onDone`/`onError` fires and `_triggerChanError`
propagates a `channelError`.
- On **iOS**, the OS buffers writes instead of surfacing a reset. The
only fallback was the app-level Phoenix heartbeat, whose recovery path
calls `conn.sink.close()`, which does not reliably fire `onDone` on a
dead iOS socket. So nothing propagated to the channel.

## How

Set `pingInterval` (new `Constants.defaultWebSocketPingInterval`, 25s,
aligned with the existing heartbeat cadence) on the native WebSocket.
`dart:io` now actively probes the peer and closes the connection
(`goingAway`) when a pong is not received, which flows through the same
`onDone → _onConnClose → _triggerChanError → reconnect` path Android
already uses.

## Scope / safety

- Only the default native transport changes. Web (`websocket_web.dart`)
is untouched, since browsers manage ping/pong internally.
- Custom transports injected via `RealtimeClientOptions.transport` are
unaffected.
- No public API change: the `WebSocketTransport` typedef is unchanged.
- A 25s pong window is generous for mobile round-trips.

## Testing

- `dart analyze` clean on the changed files.
- Realtime unit suite passes (`socket_test`, `mock_test`,
`channel_test`, including the existing
CHANNEL_ERROR-on-heartbeat-timeout test).
- Files formatted.

No unit test added: `pingInterval` is a p... (continued)

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

34 existing lines in 3 files now uncovered.

4101 of 4814 relevant lines covered (85.19%)

3.58 hits per line

Coverage Regressions

Lines Coverage ∆ File
27
62.5
-0.61% packages/supabase_flutter/lib/src/supabase_auth.dart
6
85.03
-1.03% packages/supabase/lib/src/supabase_stream_builder.dart
1
85.37
-2.13% packages/supabase_flutter/lib/src/local_storage.dart
Jobs
ID Job ID Ran Files Coverage
6 realtime_client - 27970805559.6 22 Jun 2026 05:21PM UTC 11
88.15
GitHub Action Run
7 supabase - 27970805559.7 22 Jun 2026 05:19PM UTC 15
81.99
GitHub Action Run
8 supabase_flutter - 27970805559.8 22 Jun 2026 05:20PM UTC 11
77.27
GitHub Action Run
1 postgrest - 27952543454.1 22 Jun 2026 12:30PM UTC 9
84.16
GitHub Action Run
2 functions_client - 27952543454.2 22 Jun 2026 12:27PM UTC 2
97.14
GitHub Action Run
6 gotrue - 27963702382.6 22 Jun 2026 03:26PM UTC 26
83.52
GitHub Action Run
3 yet_another_json_isolate - 27952543454.3 22 Jun 2026 12:27PM UTC 1
79.03
GitHub Action Run
4 storage_client - 27952543454.4 22 Jun 2026 12:29PM UTC 5
93.0
GitHub Action Run
Source Files on build 27970805559
  • Tree
  • List 80
  • Changed 8
  • Source Changed 8
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #27970805559
  • db754cf0 on github
  • Prev Build on main (#27970191844)
  • Next Build on main (#27986095786)
  • 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