Channels does not load in first run

Hi

I have forked sendbird-uikit-ios in my project and made custom changes according to my requirement, which is working pretty smooth. But there is one case when I install a fresh version of my app, it doesn’t load user’s channels apart from Push Notifications channels. However, it loads all the channels in second run.

I tried digging SBUChannelListModel where the query gets created and loadNextChannelList are being called to load list. I also tried debugging the query which is same in both the cases.

What could I possibly be doing wrong?
Could anyone please point me the right direction?

Thanks

Hi @Upgame_Golf,

Welcome to the Sendbird Community.

In order to help diagnose this, we’re going to need a lot more information. Could you provide the following:

  • Version of UIKit being utilized
  • Custom changes you made
  • Video of the issue
  • Network logs of the request that is made the first time the app is installed and channels are requested.

Thanks,
Tyler

Hi @Tyler

Thanks for your revert.

Please find the inline answers and attached videos of the issue.

  • Version of UIKit being utilized

v2.2.5 this was the last tagged version from Tez

  • Custom changes you made

We have mainly created a different types of cells and override a few button actions

  • Video of the issue

Two videos are attached

  • Network logs of the request that is made the first time the app is installed and channels are requested.

I am adding the query which is being created to fetch channels and channel count which are as follows

First run when channel count is 2

[AnyHashable(\"show_frozen\"): 1, AnyHashable(\"token\"): , AnyHashable(\"user\"): {\n    \"is_active\" = 1;\n    \"last_seen_at\" = 0;\n    nickname = Pop14;\n    \"preferred_languages\" =     (\n    );\n    \"profile_url\" = \"https://s3.upgame.app/public/profile-picture/641066f7-071d-43f1-ad07-1e5cd9050855_ff0fba9e-d275-411f-8ebf-1e1796afbc8f.webp\";\n    \"require_auth_for_profile_image\" = 0;\n    \"user_id\" = \"641066f7-071d-43f1-ad07-1e5cd9050855\";\n    version = \"3.1.18\";\n}, AnyHashable(\"member_state_filter\"): all, AnyHashable(\"hidden_mode\"): unhidden_only, AnyHashable(\"limit\"): 20, AnyHashable(\"unread_filter\"): all, AnyHashable(\"show_member\"): 1, AnyHashable(\"public_mode\"): all, AnyHashable(\"order\"): latest_last_message, AnyHashable(\"query_type\"): and, AnyHashable(\"super_mode\"): all, AnyHashable(\"show_empty\"): 1, AnyHashable(\"next\"): 1]

Second Run when all required channels are being returned

[AnyHashable(\"show_frozen\"): 1, AnyHashable(\"unread_filter\"): all, AnyHashable(\"token\"): , AnyHashable(\"query_type\"): and, AnyHashable(\"user\"): {\n    \"is_active\" = 1;\n    \"last_seen_at\" = 0;\n    nickname = Pop14;\n    \"preferred_languages\" =     (\n    );\n    \"profile_url\" = \"https://s3.upgame.app/public/profile-picture/641066f7-071d-43f1-ad07-1e5cd9050855_ff0fba9e-d275-411f-8ebf-1e1796afbc8f.webp\";\n    \"require_auth_for_profile_image\" = 0;\n    \"user_id\" = \"641066f7-071d-43f1-ad07-1e5cd9050855\";\n    version = \"3.1.18\";\n}, AnyHashable(\"hidden_mode\"): unhidden_only, AnyHashable(\"limit\"): 20, AnyHashable(\"show_empty\"): 1, AnyHashable(\"member_state_filter\"): all, AnyHashable(\"next\"): 1, AnyHashable(\"super_mode\"): all, AnyHashable(\"public_mode\"): all, AnyHashable(\"order\"): latest_last_message, AnyHashable(\"show_member\"): 1]

Video files which shows issue

Thanks

@Upgame_Golf,

Thank you for the information. With what I’ve seen in the videos, I’m definitely going to need actual network logs from something like burpsweep, proxyman or the likes. I need to see if a call is actually being made, and if so, what it’s getting back.

Hi @Tyler

Please find attached files for both cases:

case 1 file ends with _first_run
case 2 file ends with _second_run

Thanks

Hi @Upgame_Golf,

It looks like the network logs only contain a single request which is the request the SDK makes on connection, and not the actual query for channels.

Hi @Tyler

As you can see there is only request even in the second run, which is fetching all the channels.

P.S We aren’t doing anything extra to initialise sendbird, below is the code.

func setUser() {
        guard SBUGlobals.CurrentUser == nil, let user = APIClient.default.user else { return }
        SBUGlobals.CurrentUser = SBUUser(
            userId: user.id,
            nickname: user.name?.capitalized,
            profileUrl: SendbirdManager.main.stringReplacingS3String(user.profilePicture)
        )
        channelListVC.initClient()
    }

Thanks

Hi @Upgame_Golf,

I apologize for not explaining myself well. When the SDK is initialized, and you view the channel list there are a series of calls the SDK will make to the Sendbird server. The first is a dummy call which ensures that the SDK can even reach the Sendbird server. This is the only call I see in both of your network captures.

Ideally, I’d like to see logs from the moment you call connect, and the time you load the channelList. This will help me see two things:

  • If the SDK is even requesting the channel list the first time, where channels are not being displayed
  • If it does make a call, whether or not any channels are being returned.

Hi @Tyler

I have removed my custom package to figure out the issue and now using the direct package 2.2.8, given by your team.
https://github.com/sendbird/sendbird-uikit-ios-spm.git

I am attaching the video and network logs again for both the cases and I can see there is still only one request.

Logs and Videos

Thanks

Hey @Tyler

I am awaiting for your revert on the issue that we are facing. The thing is my whole team is waiting for this issue to be fixed before go live.

So, I would request you to please help me out.

Thanks

Hi @Upgame_Golf,

Apologize for the delayed response. I’ve not been able to reproduce this with our sample applications. Can you share any code on how you implemented the UIKit within your application? Such as when you initialize the SDK to when you load the channelList component the first time?

Hi @Tyler

I am using the same code as given on your git repo link.

SBUGlobals.currentUser = SBUUser(
            userId: user.id,
            nickname: user.name?.capitalized,
            profileURL: SendbirdManager.main.stringReplacingS3String(user.profilePicture)
        )

        let groupChannelListVC = SBUGroupChannelListViewController()
        let naviVC = UINavigationController(rootViewController: groupChannelListVC)
        self.present(naviVC, animated: true)

I ain’t doing anything else apart from the above piece of code to render chats.