GetStream / stream-chat-swift

💬 iOS Chat SDK in Swift - Build your own app chat experience for iOS using the official Stream Chat API
https://getstream.io/chat/sdk/ios/
Other
857 stars 209 forks source link

WebSocket does not reconnect to chat events when not using a chat list view controller #3406

Closed dfed closed 1 month ago

dfed commented 2 months ago

What did you do?

I am using Stream with a server-driven, single chat. I am therefore creating a ChatChannelVC without a ChatChannelListVC.

When a network disconnect happens, the underlying web socket reconnects, but the ChatChannelVC does not call synchronize or otherwise call POST updateChannel. This means that the web socket stops receiving any chat events, and the chat appears broken.

What did you expect to happen?

I expect experiencing a disconnect/reconnect does not prevent future typing events or chat events from being propagated to my client via web socket.

What happened instead?

Disconnect/reconnect prevented typing and chat events from being propagated to my ChatChannelVC.

I fixed it locally by subscribing to eventsController.eventPublisher(ConnectionStatusUpdated.self) and on a .connected event calling channelController.synchronize { _ in } manually.

GetStream Environment

GetStream Chat version: 4.62.0 GetStream Chat frameworks: StreamChat, StreamChatUI iOS version: 17 Swift version: 5.10 Xcode version: 15.4 Device: iPhone

laevandus commented 2 months ago

Hi @dfed,

I investigated it and identified an issue. This will be fixed in the next release 4.63.0. We'll let you know when it has been released. After the release you can remove the connection state observation.

Thank you for reporting it!

Best, Toomas

laevandus commented 1 month ago

Hi @dfed, we just released 4.63.0, please upgrade and remove the custom code what you added for mitigating the previous issue.

Thank you for reporting, Toomas

dfed commented 1 month ago

Done! Working great. Thanks for fast turnaround!