stream-chat-android icon indicating copy to clipboard operation
stream-chat-android copied to clipboard

Issue with predicate filter

Open spvince opened this issue 3 years ago • 0 comments

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

spvince avatar Oct 05 '22 15:10 spvince