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

supabase / supabase-swift / 24883910750
81%

Build:
DEFAULT BRANCH: main
Ran 24 Apr 2026 10:10AM 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

24 Apr 2026 10:04AM UTC coverage: 81.155% (+0.2%) from 80.992%
24883910750

push

github

web-flow
feat(realtime): handle app lifecycle background/foreground transitions (#967)

* feat(realtime): handle app lifecycle background/foreground transitions

Add automatic app lifecycle handling to RealtimeClientV2. When enabled,
the client disconnects on background and reconnects (re-joining any
existing channels) on foreground.

- New RealtimeLifecycleManager observes UIApplication/NSApplication
  background/foreground notifications and drives the client
- New public setAppStateActive(_:) method for manual control or custom
  lifecycle integration
- New RealtimeClientOptions.handleAppLifecycle option (default true on
  iOS/tvOS/visionOS/macOS, false elsewhere)
- Extracted rejoinChannels() as async so it can be awaited by
  setAppStateActive after reconnecting

Closes: #595

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

* refactor(realtime): don't proactively disconnect on background

Instead of tearing down the WebSocket every time the app backgrounds
(which churns rapid background/foreground cycles like Control Center or
notification pulls), leave the connection in place and only recover on
foreground if it actually died.

- setAppStateActive(false) is a no-op; the existing error-driven reconnect
  handles OS-level teardown during suspension.
- setAppStateActive(true) only reconnects when status != .connected, then
  re-joins any existing channels.
- Lifecycle manager drops the background observer; only willEnterForeground
  / willBecomeActive are observed now.

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

* refactor(realtime): make lifecycle recovery internal as handleAppForeground

Renames the public `setAppStateActive(_:)` entry point to an internal
`handleAppForeground()` with no parameter. The method was only ever called
with `true` (background transitions are intentionally a no-op), and users
who opt out of `handleAppLifecycle` can already drive the connection with
the existing `connect()` / `disconnect(code:reason:)` APIs —... (continued)

75 of 87 new or added lines in 3 files covered. (86.21%)

7183 of 8851 relevant lines covered (81.15%)

31.08 hits per line

Uncovered Changes

Lines Coverage ∆ File
12
74.47
Sources/Realtime/RealtimeLifecycleManager.swift
Jobs
ID Job ID Ran Files Coverage
1 24883910750.1 24 Apr 2026 10:10AM UTC 90
81.15
GitHub Action Run
Source Files on build 24883910750
  • Tree
  • List 90
  • Changed 3
  • Source Changed 2
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24883910750
  • 6039edea on github
  • Prev Build on main (#24844914410)
  • Next Build on main (#24986897224)
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