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

supabase / supabase-swift / 27609350658
81%

Build:
DEFAULT BRANCH: main
Ran 16 Jun 2026 10:01AM UTC
Jobs 1
Files 90
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

16 Jun 2026 09:54AM UTC coverage: 81.699% (+0.5%) from 81.22%
27609350658

push

github

web-flow
fix(realtime): prevent deaf socket from duplicate handleConnected (SDK-959) (#1003)

* fix(realtime): prevent deaf socket from duplicate handleConnected (SDK-959)

`handleConnected(conn:)` could run twice for the same physical
connection — once synchronously from `connect()` and once from the
state-observer task when a `connect()` call (via `ensureSocketConnected`)
landed while an auto-reconnect was in flight. Each invocation re-read
`conn.events`, which reinstalls `onEvent` and registers a
`continuation.onTermination` that nils `onEvent`. When the first
event-stream's task was torn down, its `onTermination` fired and wiped
the live `onEvent`, leaving the socket connected but unable to receive
any frames.

The deaf socket dropped heartbeat and `phx_join` replies, so heartbeats
timed out every ~50s, recycling the socket and killing the in-flight
JOIN. The first channel subscribe stalled for 50s–7min until a cycle
happened to avoid the race. Introduced by the ConnectionManager
extraction in #855 (v2.44.1).

Make `handleConnected` idempotent per connection: only run
`listenForMessages` / `startHeartbeating` / `flushSendBuffer` when the
connection is new (identity guard against the cached connection), so
`conn.events` is read exactly once per socket. `rejoinChannels()` still
runs on the reconnect path regardless.

Linear: SDK-959

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(realtime): cover cold-start deafness and stale connection signals (SDK-959)

Deeper investigation of SDK-959 found the cold-start trigger and two more
defects in the same family, all stemming from lifecycle events not being
tied to a specific connection:

1. Cold-start deafness: concurrent subscribes (two channels at launch, or
   a subscribe retry racing connect) make ConnectionManager's .connecting
   wait path return the same connection to multiple connect() callers, and
   each used to run handleConnected → conn.events. Reproduced
   deterministically with an asy... (continued)

76 of 83 new or added lines in 5 files covered. (91.57%)

8 existing lines in 1 file now uncovered.

7263 of 8890 relevant lines covered (81.7%)

36.31 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
87.41
-0.83% Sources/Realtime/ChannelStateManager.swift
3
0.0
0.0% Sources/Realtime/WebSocket/URLSessionWebSocket.swift

Coverage Regressions

Lines Coverage ∆ File
8
86.43
0.39% Sources/Realtime/RealtimeClientV2.swift
Jobs
ID Job ID Ran Files Coverage
1 27609350658.1 16 Jun 2026 10:01AM UTC 90
81.7
GitHub Action Run
Source Files on build 27609350658
  • Tree
  • List 90
  • Changed 7
  • Source Changed 6
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #27609350658
  • 2681ba06 on github
  • Prev Build on main (#27553827779)
  • Next Build on main (#27610403963)
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