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

supabase / supabase-swift / 24770954858
81%

Build:
DEFAULT BRANCH: main
Ran 22 Apr 2026 09:37AM UTC
Jobs 1
Files 88
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 Apr 2026 09:29AM UTC coverage: 80.266% (+0.3%) from 79.962%
24770954858

push

github

web-flow
fix(realtime): extract ConnectionManager actor and fix connection lifecycle races (#855)

* refactor(realtime): extract connection lifecycle into ConnectionManager actor

Introduces a dedicated ConnectionManager actor that owns the WebSocket
lifecycle behind an explicit state machine (.disconnected, .connecting,
.connected, .reconnecting). RealtimeClientV2 delegates to it and observes
state changes through a single long-lived task.

Bugs fixed

- Lost phx_join reply after connect: WebSocket.events lazily installed
  onEvent only when the stream was first iterated. Reading conn.events
  synchronously before spawning the message task ensures replies aren't
  dropped.
- status race on connect() return: yielded synchronously from connect()/
  disconnect() with dedup so callers (e.g. RealtimeChannelV2._subscribe)
  don't see stale .connecting.
- Duplicate / missing status transitions: observer no longer double-emits
  on the normal connect path; reconnect path explicitly emits .disconnected
  before the reconnect attempt.
- Concurrent connect() calls: the actor's .connecting case now awaits the
  in-flight task instead of starting a second transport.
- disconnect() did not cancel in-flight connect: now cancels .connecting /
  .reconnecting tasks.
- Double-close on remote-initiated close: handleClose only updates state.
- Reconnect not testable / fired under cancellation: uses _clock.sleep(for:)
  and skips CancellationError.
- Task leaks across reconnects: handleConnected cancels-then-replaces
  messageTask and heartbeatTask.

Public API is unchanged. disconnect() stays synchronous (actor call
dispatched on a detached Task).

Tests

- New ConnectionManagerTests covers the state machine directly.
- 172/172 Realtime tests pass locally.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(realtime): address code review feedback

- Remove file headers (date conflicts with git blame).
- Mark ConnectionManager.State as Sendable for safe actor bounda... (continued)

227 of 277 new or added lines in 2 files covered. (81.95%)

5 existing lines in 1 file now uncovered.

6817 of 8493 relevant lines covered (80.27%)

29.8 hits per line

Uncovered Changes

Lines Coverage ∆ File
35
77.93
0.56% Sources/Realtime/RealtimeClientV2.swift
15
88.19
Sources/Realtime/ConnectionManager.swift

Coverage Regressions

Lines Coverage ∆ File
5
77.93
0.56% Sources/Realtime/RealtimeClientV2.swift
Jobs
ID Job ID Ran Files Coverage
1 24770954858.1 22 Apr 2026 09:37AM UTC 88
80.27
GitHub Action Run
Source Files on build 24770954858
  • Tree
  • List 88
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24770954858
  • dcbc63d5 on github
  • Prev Build on main (#24767543194)
  • Next Build on main (#24827499402)
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