-
Notifications
You must be signed in to change notification settings - Fork 110
Fix multiple issues around mark unread and unread banner #989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
nuno-vieira
merged 10 commits into
develop
from
fix/unread-message-banner-for-small-channels
Oct 2, 2025
Merged
Fix multiple issues around mark unread and unread banner #989
nuno-vieira
merged 10 commits into
develop
from
fix/unread-message-banner-for-small-channels
Oct 2, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Interface open class ChatChannelViewModel: ObservableObject, MessagesDataSource
- @Published public private var channel: ChatChannel?
+ public var currentUserMarkedMessageUnread: Bool
- public var isMessageThread: Bool
+ @Published public private var channel: ChatChannel?
-
+ public var isMessageThread: Bool
-
+
- public init(channelController: ChatChannelController,messageController: ChatMessageController? = nil,scrollToMessage: ChatMessage? = nil)
+
-
+ public init(channelController: ChatChannelController,messageController: ChatMessageController? = nil,scrollToMessage: ChatMessage? = nil)
-
+
- public func scrollToLastMessage()
+
- public func messageSentTapped()
+ public func scrollToLastMessage()
- public func jumpToMessage(messageId: String)-> Bool
+ public func messageSentTapped()
- open func handleMessageAppear(index: Int,scrollDirection: ScrollDirection)
+ public func jumpToMessage(messageId: String)-> Bool
- open func groupMessages()
+ open func handleMessageAppear(index: Int,scrollDirection: ScrollDirection)
- public func showReactionOverlay(for view: AnyView)
+ open func groupMessages()
- public func showBouncedActionsView(for message: ChatMessage)
+ public func showReactionOverlay(for view: AnyView)
- public func deleteMessage(_ message: ChatMessage)
+ public func showBouncedActionsView(for message: ChatMessage)
- public func resendMessage(_ message: ChatMessage)
+ public func deleteMessage(_ message: ChatMessage)
- public func editMessage(_ message: ChatMessage)
+ public func resendMessage(_ message: ChatMessage)
- open func messageActionExecuted(_ messageActionInfo: MessageActionInfo)
+ public func editMessage(_ message: ChatMessage)
- @objc public func onViewAppear()
+ open func messageActionExecuted(_ messageActionInfo: MessageActionInfo)
- @objc public func onViewDissappear()
+ @objc public func onViewAppear()
- public func setActive()
+ @objc public func onViewDissappear()
+ public func setActive() |
SDK Size
|
ecbef3f
to
ccfef78
Compare
martinmitrevski
approved these changes
Oct 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✅ Good if @testableapple runs a QA on this one.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🔗 Issue Links
IOS-968
IOS-909
IOS-426
🎯 Goal
Fix multiple issues around mark unread of messages.
📝 Summary
🛠 Implementation
One of the main issues was related to
channelController.firstUnreadMessageId
. In the LLC SDK, we already have logic in case the whole channel is unread. But on SwiftUI, we heavily use thefirstUnreadMessageId
before the channel has been remotely fetched, and thechannelController.firstUnreadMessageId
depends on thehasLoadedAllPreviousMessages
. Because of this, I had to duplicate the logic in the SwiftUI view to avoid too many risky changes.While doing all these tests, some times whenever I marked a message as unread, I noticed that it would randomly jump to somewhere else. So now, whenever we mark a message as unread, we force it to jump to the unread message.
🧪 Manual Testing Notes
Fix unread messages banner not shown for small channels
Fix the unread banner not shown if the whole channel is unread
Fix channel not marking read when passing by the unread message
Fix channel marking read when the user scrolls to the bottom after marking a message as unread
Fix marking a message unread causing the message list to randomly scroll
Fix new messages ignoring mark unread message state
Follow the steps in IOS-909
Fix replying to unread messages marking them instantly as read
Follow the steps in IOS-426
☑️ Contributor Checklist
docs-content
repo