[Problem/Question]
I have a Feed channel and a Group channel, i have couple of unread messages for both channels. I have registered to user updates via UserEventHandler, for some reason when sending messages for Group and onTotalUnreadMessageCountChanged is triggered - totalCountForFeedChannels is 0, totalCountForGroupChannels is fine.
If i send a message to Feed - the values are correct.
// What version of the SDK are you using?
sendbird_chat_sdk: 4.2.9
[Reproduction Steps]
Join a Group and Feed channel, send some messages but do not read them.
Send a message to Group
totalCountForGroupChannels - has the correct unread count
totalCountForFeedChannels is 0
[Frequency]
Always when sending messages for Group and having a feed
[Current impact]
Can’t show the correct number of unread messages for Feed
Hey Tyler, sure thing. It is pretty simple:
abstract class ChatListener {
void updateUnreadMessageBadge(int totalCountForFeedChannels, int totalCountForGroupChannels);
}
........
SendbirdChat.addUserEventHandler('ZZZ_RANDOM_ID', ChatsScreenUserlHandler(this));
.......
@override
void updateUnreadMessageBadge(int totalCountForFeedChannels, int totalCountForGroupChannels) {
print(totalCountForFeedChannels);
print(totalCountForGroupChannels);
}
......
class ChatsScreenUserlHandler extends UserEventHandler {
ChatsScreenUserlHandler(this._state);
final ChatListener _state;
@override
void onTotalUnreadMessageCountChanged(UnreadMessageCount unreadMessageCount) {
// i've printed values here as well and data are different
_state.updateUnreadMessageBadge(unreadMessageCount.totalCountForFeedChannels, unreadMessageCount.totalCountForGroupChannels);
}
@override
void onFriendsDiscovered(List<sbuser.User> friends) {}
}
My apologies for the very delayed response on this. I think this is some what expected at the moment. We don’t currently have a lot of mixed uses between our Business Messaging product and our Chat product. As a result, our Chat product may not be providing updates via websocket events for Feed Channels where as the way the feedChannel gets it, is a bit more comprehensive given it doesn’t use websockets.
I’m not sure we have a workaround at the moment outside of manually refetching the values when this occurs.