Closed Subtextaps closed 1 year ago
If I set the filter to the following no channels are shown in the channel list even though we have multiple livestream channels set up:
let filter = Filter
But If I do:
let filter = Filter
the filter works as expected and the channel list shows the messaging channels.
Hi @Subtextaps,
Thanks for reporting this. We introduced some changes for filters in 4.27.0 but there weren't any further changes in the releases after.
Just to try eliminating issue sources, you can try to disable auto-filtering in your client's configuration link:
config.isChannelAutomaticFilteringEnabled = false
and see if the problem persists.
Best, Ilias
Hi Ilias,
Thanks for the suggestion. I've tried it but it doesn't seem to change anything.
I've added a short video that shows the problem. The channels coming and going in the channel list are all of the livestream type. I suspect this might be a backend issue. Did you change anything related to the livestream channel type that might cause this?
Best,
Thomas
Hi Thomas,
There haven't been any backend changes as far as we are aware. Is there any way you can rollback to 4.27.0 and verify that the issue is not reproducible in it?
Best, Ilias
Hi Ilias,
I'm getting compiler errors in your AttachmentPickerView when using 4.27.0 in combination with Xcode 14.3 which was my reason for updating to 4.30.0 in the first place. When I roll back to 4.27.0 the compiler error returns and I'm unable to build the app. Please see attached.
So right now I'm kind of stuck with 4.30.0 unless I roll back a ton of stuff.
Best,
Thomas
If I step through the initialization of the channelListController I get this error a bunch of times in the Xcode console
Hi Ilias,
Upon further digging I found that if I set both the query and the filter parameters of the channelListController to be identical I'm able to get the ChannelListView to return a stable list of the livestream channels.
This is not mentioned in your SwiftUI documentation (https://getstream.io/chat/docs/sdk/ios/swiftui/channel-list-components/query-filters/) so I'm wondering if this is the right way to go?
If so how would I go about filtering out the channels of which the current user is a member in the filter parameter (that is: What is identical to calling this .containMembers(userIds: [chatID] on the chatChannel instance)?
Here's the code snippet:
if let chatID = self.userStatusHandler.userStatus.chatID {
let filter = Filter<ChannelListFilterScope>
.equal(.type, to: .livestream)
self.channelListController = self.chatClient.channelListController(
query: .init(filter:
filter),
filter: { chatChannel in
chatChannel.type == .livestream
}
)
I went with this and it seems to work.
Could you please have a look and let me know if this a valid and stable way to go as this is not how it's described in your SwiftUI documentation?
let filter = Filter
self.channelListController = self.chatClient.channelListController(
query: .init(filter:
filter),
filter: { chatChannel in
chatChannel.type == .livestream
||
chatChannel.membership?.memberRole == .member
})
Hi @Subtextaps!
Thank you for your report! We were able to reproduce the issue and identify the root cause 👍
We will let you know once we have a fix.
In the meantime, your workaround will be fine, but your filter will work automatically without providing a filter block once we provide the fix.
Best, Nuno
Hi @Subtextaps!
The fix is already on develop
and it will be available in the next release 👍
Best, Nuno
Great to hear – thanks for your help with this🙏🏼
Best,
Thomas
What did you do?
When updating the SDK from 4.27.0 to 4.30.0 the channel list filter logic seems to break.
What did you expect to happen?
With 4.27.0 the following piece of code would show a channel list containing all "public" livestream channels (meaning channels that any user can watch without being a member) as well as all channels of which the user is a member.
if let chatID = self.userStatusHandler.userStatus.chatID {
What happened instead?
After updating only channels of which the user is a member are shown. The livestream channels of which the user is not a member are no longer shown. Sometimes the list does show all the channels in the query briefly, right after the channel list appears. But they are removed after a second or so.
GetStream Environment
GetStream Chat version: 4.30.0 GetStream Chat frameworks: StreamChat, StreamChatSwiftUI iOS version: 16.3.1 Swift version: 5.0 Xcode version: 14.3 Device: iPhone 11
Additional context