Skip to content

Commit 705bfa3

Browse files
grdsdevclaude
andcommitted
fix(realtime): Swift 6 Sendable fixes for RealtimeClientV2 and tests
- Constrain lifecycleManager to Sendable & AnyObject to satisfy Swift 6 strict concurrency in RealtimeClientV2 - Add @unchecked Sendable to RealtimeChannelBroadcastTests (Task closure captures self implicitly) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent cbc1e86 commit 705bfa3

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

Sources/Realtime/RealtimeClientV2.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public final class RealtimeClientV2: Sendable, RealtimeClientProtocol {
6464
/// Retains the optional app-lifecycle observer for the client's lifetime.
6565
/// Stored as `AnyObject?` so this type remains available on platforms where
6666
/// the concrete `RealtimeLifecycleManager` is not compiled.
67-
var lifecycleManager: AnyObject?
67+
var lifecycleManager: (any Sendable & AnyObject)?
6868

6969
/// Whether the socket was `.connected` the last time the app entered the
7070
/// background. `handleAppForeground` only attempts recovery when this is

Tests/RealtimeTests/RealtimeChannelBroadcastTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import XCTest
2121
#else
2222

2323
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
24-
final class RealtimeChannelBroadcastTests: XCTestCase {
24+
final class RealtimeChannelBroadcastTests: XCTestCase, @unchecked Sendable {
2525
let url = URL(string: "http://localhost:54321/realtime/v1")!
2626
let apiKey = "publishable.api.key"
2727

0 commit comments

Comments
 (0)