unreadMessageCount mismatch

unreadMessageCount mismatch between groupChannelHandler events and groupChannel.getTotalUnreadMessageCount() method after reconnect.

There is an issue of mismatching unreadMessageCounts being returned from different parts of the sdk after reconnect. The sdk.groupChannel.getTotalUnreadMessageCount gives the correct count (includes the messages, that were sent, while the current user had no connection), while the onChannelChanged and onMessageReceived handler function ‘channel’ argument has an out of sync unreadMessageCount (does not include the messages, which were sent while the user had no connection).

SDK version: 4.9.14

[Reproduction Steps]

setup onChannelChanged handler to call sdk.groupChannel.getTotalUnreadMessageCount().
Do not open the chat, that we will send the messages to ( USER 1)

  1. Send a message, observe the counts from sdk.groupChannel.getTotalUnreadMessageCount() and onChannelChanged() are in sync, and return correct values.

  2. Go offline in one browser (in the network tab).

  3. Send a message from USER 2 browser to the chat, that the USER 1 is in.

  4. Go back online in the first browser.

  5. Send another message from the USER 2 browser to the USER 1.

  6. Observe, that the sdk.groupChannel.getTotalUnreadMessageCount() returns correct value of unread_count (2), but the channel argument, in the onChannelChanged function returns incorrect value of unreadMessageCount (1).

Happens every time you follow the steps;

[Current impact]
We have a custom channel list, which depends on the onChannelChanged event handler to be up to date, but it is not reliable now, and our users are seeing unsinchronised message counts.