UserEventHandler not sending correct number for Feed's unread messages

[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

Hello @Vladimir_Plotean,

Welcome to the Sendbird Community.
Can you share your implementation for the UserEventHandler in Flutter please?

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) {}
}

Hey @Tyler do you have any updates on the issue ? Do i need to provide more information?