V5: Use web-socket client from StreamCore - #3861
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Generated by 🚫 Danger |
…tion" This reverts commit 7e38507.
SDK Performance
|
| set { connectionQueue.async(flags: .barrier) { self._connectionId = newValue }} | ||
| } | ||
|
|
||
| let webSocketConnectEndpoint = AllocatedUnfairLock<Endpoint<EmptyResponse>?>(nil) |
There was a problem hiding this comment.
Endpoint used to be in WebSocketClient, but the one from StreamCore does not use endpoint type, so this logic was moved to here.
There was a problem hiding this comment.
yes, and it would make it easier to migrate away from endpoints to generated code.
| let event = ConnectionStatusUpdated(webSocketConnectionState: state) | ||
| if event.connectionStatus != connectionStatus { | ||
| // Publish Connection event with the new state | ||
| webSocketClient?.publishEvent(event) | ||
| } |
There was a problem hiding this comment.
Used to be in WebSocketClient. Since this is a custom event, I left it here instead.
| syncRepository.syncLocalState { | ||
| log.info("Local state sync completed", subsystems: .offlineSupport) | ||
| } |
There was a problem hiding this comment.
Was in WebSocketClient, now it is here
There was a problem hiding this comment.
yes, this is chat specific logic
|
|
||
| /// The type is designed to pre-process some incoming `Event` via middlewares before being published | ||
| class EventNotificationCenter: NotificationCenter, @unchecked Sendable { | ||
| class PersistentEventNotificationCenter: NotificationCenter, EventNotificationCenter, @unchecked Sendable { |
There was a problem hiding this comment.
Easier to have a different type than trying to migrate this to StreamCore.
| set { connectionQueue.async(flags: .barrier) { self._connectionId = newValue }} | ||
| } | ||
|
|
||
| let webSocketConnectEndpoint = AllocatedUnfairLock<Endpoint<EmptyResponse>?>(nil) |
There was a problem hiding this comment.
yes, and it would make it easier to migrate away from endpoints to generated code.
| let event = ConnectionStatusUpdated(webSocketConnectionState: state) | ||
| if event.connectionStatus != connectionStatus { | ||
| // Publish Connection event with the new state | ||
| webSocketClient?.publishEvent(event) | ||
| } |
| syncRepository.syncLocalState { | ||
| log.info("Local state sync completed", subsystems: .offlineSupport) | ||
| } |
There was a problem hiding this comment.
yes, this is chat specific logic
Public Interface- public enum ConnectionStatus: Equatable, Sendable
-
- case initialized
- case disconnected(error: ClientError? = nil)
- case connecting
- case connected
- case disconnecting
- public struct APIKey: Equatable, Sendable
-
- public let apiKeyString: String
-
-
- public init(_ apiKeyString: String)
- public protocol Event: Sendable
- public final class IgnoredEventType: ClientError, @unchecked Sendable
-
- override public var localizedDescription: String
public final class HealthCheckEvent: ConnectionEvent, EventDTO, Sendable
+
+
+ public func healthcheck()-> HealthCheckInfo? |
* V5: Use web-socket client from StreamCore (#3861)
SDK Size
|
StreamChat XCSize
Show 248 more objects
|
StreamChatUI XCSize
Show 291 more objects
|
|



🔗 Issue Links
Fixes IOS-1205
🎯 Goal
Use WebSocketClient from StreamCore which has slightly different interface
📝 Summary
Provide bullet points with the most important changes in the codebase.
🛠 Implementation
Provide a detailed description of the implementation and explain your decisions if you find them relevant.
🎨 Showcase
Add relevant screenshots and/or videos/gifs to easily see what this PR changes, if applicable.
🧪 Manual Testing Notes
Explain how this change can be tested manually, if applicable.
☑️ Contributor Checklist
docs-contentrepo