-
Notifications
You must be signed in to change notification settings - Fork 222
ChannelListController synchronize taking a long time #3682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @kylelol, What query are you using? In our Demo App, this takes on average about 1.5s, 2s at most. Can also try to update the messageLimit parameter to see if this improves anything. Maybe change it to 5. Best, |
@nuno-vieira This is what my query looks like: currentChannelController = client?.channelListController(
query: ChannelListQuery(
filter: .and([
.containMembers(userIds: [client?.currentUserId ?? ""]),
.equal("student_status", to: true)
])
)
) Adding the message limit to 5 didn't have much of an impact, still takes about 3.8-4.0 seconds to synchronize. The only thing that has a meaningful impact is lowering the page size.
Since the network request happens quickly it seems the persistency layer is what is taking up the most time here. Are there logs I can enable to help further investigate? Also found this to show the SDK is reporting similar numbers:
|
Hi @kylelol. The log Can you try removing this Thank you! |
Hi @kylelol, I've transfered the issue to the Low level SDK. Since this is not related to SwiftUI. Have you had the opportunity to look into my comment above? Thank you! |
@nuno-vieira Sorry for the delay, so it seems like the biggest impact is passing in the Could you explain why that is necessary and what impact that might have? Or are we doing something wrong with our channels on the server side? |
That looks like your member's data is slowing down our database layer. Can you share the HTTP response to my email at [email protected]? Make sure to share the HTTP request without any changes of the membersLimit. Some additiona questions:
Best, |
@nuno-vieira Yes I can, do you want the http request without the Also this is the http request on the iOS client that fetches the channels right? |
@kylelol Yes, share the response without any limit. Yes this is the channel list query. |
@nuno-vieira Sent! |
What did you do?
After connecting a user to our chat, I am creating my
ChannelListController
and manually callingsynchronize
in order to attempt to have all the channels loaded before the user navigates to our chat feature.I'm noticing that the
synchronize
call takes about ~3.5-5 seconds on average to actually finish and call the completion. I am fetching the default page size 20 channelsI inspected the network requests and the one that fetches the channels finishes in about 300ms. I'm not sure exactly what the SDK does after that but taking 3.5-5 seconds for 20 channels that don't have a lot of messages feels like a bit too long.
If a user navigates to our chat experience very quickly, they sit there and wait in the loading state until it finishes.
What did you expect to happen?
I would expect the synchronize call to finish in 1-2 seconds if the network requests finishes in 300ms
What happened instead?
They synchronize call took about ~3.5-5 seconds.
This also seems to carry over to our search, sometimes the search takes a good 3-5 seconds to return a result, and it also seems to returns channels that are not in my channel list normally.
GetStream Environment
GetStream Chat version: 4.76
GetStream Chat frameworks: StreamChat, StreamChatSwiftUI
iOS version: 18.3
Swift version: 5
Xcode version: 16.2
Device: iPad simulator
Additional context
Here are some screenshots from Proxyman and my own logging to showcase what is going on:
This is the initial set of network requests that happen when the app is launched and we:
connect
on the SDKsynchronize
on our createdChannelListController
This screenshot just showcases the response time of the channels call:
This screenshot shows the time measurement of the synchronize call after we connect and create our channel list controller
The text was updated successfully, but these errors were encountered: