Skip to content

Commit e84e41f

Browse files
authored
Add LivestreamChannelController (#3750)
* 1st WIP * Handle more mapping * Make message list diff kit to support updating from Array instead of LazyCollection * Handle events in LivestreamChannelController * fixup message list view * Add reads and attachments * Forward live stream events and don't save them into the DB * Use currentUserId and channel from DB for now (Maybe implement caching later) * Simplify model mapping * Fix current user reactions * Improve how event notification center knows when to do manually event handling * Do WIP on reads * Remove reads since it is not needed for live streams * Add DemoLivestreamChannelVC to the DemoApp * Remove unread stuff from LivestreamChannelController * Add ChatLivestreamChannelVC to be able to test * Handle message errors * Fix regular controller not working after showing as livestream * Fix sometimes messages disappearing from the view * Quick jumps fix for Live Stream * Fix some minor typos * Move Payload to asModel() to seperate files * Handling new messages while first page is not loaded * Remove atomics * Add API only message actions to the livestream controller - deleteMessages - loadReactins - flag - unflag - addReaction - deleteReaction - pin - unpin * Add createNewMessage to `LivestreamChannelController` * Remove markRead from livestream controller * Load initial page from cache * Add reaction groups and moderation details to Message Payload model mapping * If event is not handled, fallback to middlewares * Add Combine support for livestream controller * Handle channel update events and make it easier to notify delegates * Cache local channels when handling manual events * Fix not loading older pages when in skip logic * Add slow mode support to Livestream Controller * Extract manual event handling logic to a ManualEventHandler * Fix merge conflict * CodeRabit review feedback changes * Cleanuo livestream channel controller * Cleanup model mapping * Move livestream UI to the demo app * Quick fix typo * Handle pagination with willDisplayAt * Log a warning instead of a error when a feature is disabled * Do not use channel controller in the composer * Fix message actions on livestream demo UI * Fix minor warning * Add support for setting max number of messages in livestream controller * Add a way to check how much messages were skipped when the controller was paused * Add `isPause` publisher * Disable the discarding of messages by default * Reset the live stream channel controller when memory warning is received * Fix attachments not working * Explicitly disable commands * Fix access control of livestream channel view * Use reactions from livestream controller in the demo app livestream UI * Display list of reaction authors when tapping the reactions in the message list * Change the thread to utility in the Manual Event Handler * Do not copy the current message everytime when doing in-memory message updates * Improve doc of livestream channel controller message capping * Print whenever the livestream messages are updated * Only count skipped messages if enabled * Make the completion blocks and delegates as main actors * Fix loadReactions completion not in the MainActor * Fix thread-safeness when fetching cached channel in manual event handler * Remove cooldown protections * Fix creating a new message not resuming the controller * Save the channel to the DB on the first page fetch * Remove unnecessary isBounce in live reactions view * Add loadPinnedMessage to livestream controller * Handle channel updates through the DB * Update CHANGELOG.md * Fix existing tests * Remove ChannelDetailPayload as model since it is not used * Fix tests related to pending messages * Add test coverage to user payload model conversion * Add test coverage to message payload model conversion * Add test coverage to channel payload model conversion * Add missing tests to disable slow mode * Add test coverage to LivestreamChannelController * Fix UI Tests not compiling * Add combine test coverage * Add memory warning test coverage * Add missing test coverage to the event notification centre * Add test coverage to ManualEventHandler
1 parent daf75bf commit e84e41f

File tree

45 files changed

+6387
-224
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+6387
-224
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66
## StreamChat
77
### ✅ Added
88
- Add pending messages support [#3754](https://github.com/GetStream/stream-chat-swift/pull/3754)
9+
- Add new lightweight `LivestreamChannelController` that improves performance for live chats [#3750](https://github.com/GetStream/stream-chat-swift/pull/3750)
910
### 🐞 Fixed
1011
- Fix `ChatClient.currentUserId` not removed instantly after calling `logout()` [#3766](https://github.com/GetStream/stream-chat-swift/pull/3766)
1112

0 commit comments

Comments
 (0)