Open oleg-hf opened 5 days ago
Hi @oleg-hf,
Can you please share a video of the issue happening? Otherwise, it is difficult to understand what the actual issue is.
Thank you, Nuno
Capturing the issue with unreadCountPublisher
in a video is challenging because it requires multiple Xcode simulators and debugging in the background. Here's a verbal explanation:
Scenario #1 (Issue):
currentUserController.unreadCountPublisher
on user B's device is not emitting a new value and the unreadCount.messages
for User B does not increase (verified with Xcode breakpoints).Additional Issue for Scenario #1:
ChatChannelListView
.ChatChannelListView
as if the message was read, but it wasn't.Scenario #2 (Working as Expected):
currentUserController.unreadCountPublisher
on User B's device updates correctly, increasing the unread count for messages
.ChatChannelListView
remains visible even after closing and reopening the chat.Hi @oleg-hf,
Thank you for the detailed description. Now it is more clear. I just did not understood this part:
After closing and reopening the chat, the badge disappears from ChatChannelListView as if the message was read, but it wasn't.
Which user, A or B? And if the user opened the chat, then it means he read the message, right? Isn't this expected?
We will investigate this a little more deeper as soon as we can. We will let you know once we have more details.
Best, Nuno
Which user, A or B? And if the user opened the chat, then it means he read the message, right? Isn't this expected?
By "opening the chat" I meant opening the screen based on ChatChannelListView. User B hasn't opened the 1:1 chat yet. When user B reopens the ChatChannelListView, the unread badge disappears even if they haven't opened the 1:1 chat with user A.
Hi @oleg-hf,
I see, we will get back to you once we investigate this one in more detail.
Thank you for the report.
What did you do?
Added subscription for unreadCountPublisher in the ChatManager object.
What did you expect to happen?
The unreadChatMessages value should increase when a new message is sent in any channel, whether it's a group or a 1:1 chat.
What happened instead?
The unreadChatMessages value increases only for channels with three or more members. When a new message is sent in 1:1 channels, the unreadChatMessages value does not increase. Although the unread count red badge in the channel list increases, it disappears after closing and reopening the chat. The unread count red badge value is not related to the unreadChatMessages value bound to unreadCountPublisher.
GetStream Environment
GetStream Chat version: 4.63.0
GetStream Chat frameworks: StreamChat, StreamChatSwiftUI 4.63.0
iOS version: 17.5, 16.4
Swift version: 5
Xcode version: Version 16.1 (16B40)
Device: iPhone 13, 14
Additional context
It would be helpful to know if there are other publishers that emit values for 1:1 chats and why the unread count badge disappears when reopening the channel list. I want to emphasize that the badge in the list and the unreadCountPublisher's value for messages in group chats work as expected.
Both group chats and 1:1 chats are created using the same method: