Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
SDK Performance
|
Public Interface+ public struct GroupedChannelsGroup: Equatable
+
+ public let channels: [ChatChannel]
+ public let unreadCount: Int
+ public let unreadChannels: Int
+
+
+ public init(channels: [ChatChannel],unreadCount: Int,unreadChannels: Int)
+ public struct GroupedChannels: Equatable
+
+ public let groups: [String: GroupedChannelsGroup]
+
+
+ public init(groups: [String: GroupedChannelsGroup])
+ public protocol HasGroupedUnreadChannels: Event
- public final class MessageNewEvent: ChannelSpecificEvent, HasUnreadCount
+ public final class MessageNewEvent: ChannelSpecificEvent, HasUnreadCount, HasGroupedUnreadChannels
+ public let groupedUnreadChannels: GroupedUnreadChannels?
public class ChatChannelListController: DataController, DelegateCallable, DataStoreProvider
- @available(*, deprecated, message: "Please use `markAllRead` available in `CurrentChatUserController`") public func markAllRead(completion: ((Error?) -> Void)? = nil)
+ public func prefill(channels: [ChatChannel],completion: ((Error?) -> Void)? = nil)
+ @available(*, deprecated, message: "Please use `markAllRead` available in `CurrentChatUserController`") public func markAllRead(completion: ((Error?) -> Void)? = nil)
- public final class NotificationMarkReadEvent: ChannelSpecificEvent, HasUnreadCount
+ public final class NotificationMarkReadEvent: ChannelSpecificEvent, HasUnreadCount, HasGroupedUnreadChannels
- public let lastReadMessageId: MessageId?
+ public let groupedUnreadChannels: GroupedUnreadChannels?
- public let createdAt: Date
+ public let lastReadMessageId: MessageId?
+ public let createdAt: Date
- public final class NotificationMarkUnreadEvent: ChannelSpecificEvent
+ public final class NotificationMarkUnreadEvent: ChannelSpecificEvent, HasGroupedUnreadChannels
- public let unreadMessagesCount: Int
+ public let groupedUnreadChannels: GroupedUnreadChannels?
+ public let unreadMessagesCount: Int
- public final class NotificationMessageNewEvent: ChannelSpecificEvent, HasUnreadCount
+ public final class NotificationMessageNewEvent: ChannelSpecificEvent, HasUnreadCount, HasGroupedUnreadChannels
+ public let groupedUnreadChannels: GroupedUnreadChannels?
public class ChatClient
- @available(*, deprecated, message: "Use the asynchronous version of `disconnect` for increased safety") public func disconnect()
+ public func groupedQueryChannels(limit: Int? = nil,watch: Bool = false,presence: Bool = false,completion: @escaping (Result<GroupedChannels, Error>) -> Void)
- public func disconnect(completion: @escaping () -> Void)
+ public func groupedQueryChannels(limit: Int? = nil,watch: Bool = false,presence: Bool = false)async throws -> GroupedChannels
- public func disconnect()async
+ @available(*, deprecated, message: "Use the asynchronous version of `disconnect` for increased safety") public func disconnect()
- @available(*, deprecated, message: "Use the asynchronous version of `logout` for increased safety") public func logout()
+ public func disconnect(completion: @escaping () -> Void)
- public func logout(removeDevice: Bool = true,completion: @escaping () -> Void)
+ public func disconnect()async
- public func logout()async
+ @available(*, deprecated, message: "Use the asynchronous version of `logout` for increased safety") public func logout()
- public func subscribe(toEvent event: E.Type,handler: @escaping (E) -> Void)-> AnyCancellable
+ public func logout(removeDevice: Bool = true,completion: @escaping () -> Void)
- public func subscribe(_ handler: @escaping (Event) -> Void)-> AnyCancellable
+ public func logout()async
- public func loadAppSettings(completion: ((Result<AppSettings, Error>) -> Void)? = nil)
+ public func subscribe(toEvent event: E.Type,handler: @escaping (E) -> Void)-> AnyCancellable
- public func loadAppSettings()async throws -> AppSettings
+ public func subscribe(_ handler: @escaping (Event) -> Void)-> AnyCancellable
- public func upload(_ attachment: StreamAttachment<Payload>,progress: ((Double) -> Void)?,completion: @escaping (Result<UploadedFile, Error>) -> Void)
+ public func loadAppSettings(completion: ((Result<AppSettings, Error>) -> Void)? = nil)
- public func uploadAttachment(localUrl: URL,progress: ((Double) -> Void)?,completion: @escaping (Result<UploadedFile, Error>) -> Void)
+ public func loadAppSettings()async throws -> AppSettings
- public func deleteAttachment(remoteUrl: URL,completion: @escaping (Error?) -> Void)
+ public func upload(_ attachment: StreamAttachment<Payload>,progress: ((Double) -> Void)?,completion: @escaping (Result<UploadedFile, Error>) -> Void)
+ public func uploadAttachment(localUrl: URL,progress: ((Double) -> Void)?,completion: @escaping (Result<UploadedFile, Error>) -> Void)
+ public func deleteAttachment(remoteUrl: URL,completion: @escaping (Error?) -> Void)
- public final class ChannelTruncatedEvent: ChannelSpecificEvent
+ public final class ChannelTruncatedEvent: ChannelSpecificEvent, HasGroupedUnreadChannels
+ public let groupedUnreadChannels: GroupedUnreadChannels?
- public final class NotificationChannelDeletedEvent: ChannelSpecificEvent
+ public final class NotificationChannelDeletedEvent: ChannelSpecificEvent, HasGroupedUnreadChannels
+ public let groupedUnreadChannels: GroupedUnreadChannels?
public class CurrentChatUser: ChatUser
- public let isInvisible: Bool
+ public let groupedUnreadChannels: GroupedUnreadChannels?
- public let privacySettings: UserPrivacySettings
+ public let isInvisible: Bool
- public let pushPreference: PushPreference?
+ public let privacySettings: UserPrivacySettings
+ public let pushPreference: PushPreference? |
SDK Size
|
StreamChat XCSize
Show 28 more objects
|
|



🔗 Issue Links
Resolves https://linear.app/stream/issue/IOS-1635/support-for-grouped-channels-endpoint.
🎯 Goal
ChatChannelListController.prefill(channels:completion:)for priming controller-local channel data before the first synchronize call while preserving normal pagination, observation, and offline refresh behaviorChatClient.groupedQueryChannels(limit:watch:presence:)to fetch grouped channel groups asGroupedChannels, preserving backend group keys and exposing normalized per-group channels and unread counts for integratorsgroupedUnreadChannelsdata to grouped unread websocket events and persist it onCurrentChatUserfor integrators📝 Summary
Test on https://github.com/GetStream/GroupedChannelsSample.
🛠 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