stream-chat-android
stream-chat-android copied to clipboard
Issue with predicate filter
Describe the bug
I use the code below to filter channel because i want to display in channel list view only channel which have 1 new message. If my app isn't started, then i receive a message, then i launch my app, it's work well. But when my app is launched and visible on screen, when i receive a new message the channel isn't displayed.
This code works well with sdk 4.30.1 but not with 5.8.1
channelsListView.setChannelListItemPredicate { channelListItem ->
when (channelListItem) {
is ChannelListItem.LoadingMoreItem -> {
true
}
is ChannelListItem.ChannelItem -> {
val count = channelListItem.channel.getUnreadMessageCount(mSpUser.id)
Timber.d("initStreamChatView - predicate unread message in this channel : $count")
count > 0
}
}
}
SDK version
- 5.8.1
Device:
- Vendor and model: pixel 2 xl
- Android version: 12