Tags: ts95/WatchConnectivitySwift
Tags
Release v5.2.0 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Release v5.1.0 Changes since v5.0.0: - Fix multicast stream bug allowing multiple subscribers to receive updates - Add MulticastStream class for broadcasting to multiple AsyncStream consumers - Use Swift 6 isolated deinit for safe cleanup in SharedState - Rename types to WCSession prefix convention (breaking change): - SessionProviding → WCSessionProviding - PreviewSession → PreviewWCSession - MockSession → MockWCSession - FlakySession → FlakyWCSession - Add comprehensive unit tests for multicast behavior - Add E2E tests for bidirectional communication (watchOS → iOS) - Add E2E tests for multiple SharedState multicast - Update all documentation to reflect v5.0.0 API changes - Remove outdated references to versioning, rate-limiting, and removed types Co-Authored-By: Claude Opus 4.5 <[email protected]>
Release v5.0.0: Complete rewrite with Swift 6 concurrency This is a complete rewrite of WatchConnectivitySwift with a modern API designed for Swift 6 strict concurrency and async/await patterns. ## New Features - **Type-safe request/response**: `WatchRequest` protocol with associated `Response` type - **Handler registration**: Register handlers with closures instead of subclassing - **SharedState<T>**: Automatic state synchronization via `applicationContext` using @observable - **File transfers**: Full support with progress tracking and async/await - **Retry policies**: Built-in `.default`, `.patient`, `.none` with fixed 200ms delay - **Delivery strategies**: Fallback mechanisms (message → userInfo → context) - **Session health monitoring**: Track connection health with recovery suggestions - **Diagnostic events**: AsyncStream for debugging connectivity issues - **E2E test infrastructure**: Paired iOS/watchOS simulator testing ## Breaking Changes from v1.0.0 - Main class renamed from `WatchConnectivityRPCRepository` to `WatchConnection` - Request/response uses associated types instead of separate protocols - All APIs are async/await instead of completion handlers - Requires iOS 17.0+ / watchOS 10.0+ / Swift 6.0+ ## API Overview ```swift // Define requests struct FetchRecipeRequest: WatchRequest { typealias Response = Recipe let id: String } // Register handlers connection.register(FetchRecipeRequest.self) { request in return try await fetchRecipe(id: request.id) } // Send requests let recipe = try await connection.send(FetchRecipeRequest(id: "123")) // Shared state let settings = SharedState(initialValue: Settings(), connection: connection) try settings.update(newSettings) ``` Co-Authored-By: Claude Opus 4.5 <[email protected]>