getChannels doesn't return a conversation channel

We recently migrated to the TS SDK, and a few days ago we had a issue reported from production that they recieved a message in a channel refreshed the page and could never see the channel again.

When we tested on our end the channel exists and can be found if directly searched for by channelId, it has the same tag/channelPrefill in the channel data as all others that are recieved from amity api. And the users that is filtering for the channel is a part of the users in the channel.

The filter sent to getChannels should match the channel but we do not recieve it,

const filter = {

            displayName: channelNamePrefill ? channelNamePrefill + searchQuery : undefined,

            types: ["conversation"],

            membership: "member",

            sortBy: "lastActivity",

            tags: [channelTag],

            limit: 20,

        }

Hello @Svrle , We’re currently unable to reproduce the issue on our side.
To investigate further, could you please share version you’re using where the problem occurs?

@SocialPlus_Support@amityco/ts-sdk”: “7.8.6”
If you need any further information let me know.

Hello @Svrle , We’ve checked this scenario using the same version as yours, but we’re unable to reproduce the issue on our side.

Could you please confirm whether you’re logging in with a userId that is a member of the target channel ? This call will only succeed if the user is already a member.

@SocialPlus_Support The user that is logged in at the time when the request is sent is indeed part of that conversation.
It is a “admin” type user that is in every single channel.

Hello @Svrle , Thank you for the details.
To help us investigate further, could you please share the exact display name that you used in your search when the issue occurred?

Our team will use that value to replicate the same query and verify why the channel isn’t being returned by the getChannels filter.

Thank you so much for your help :folded_hands:

@SocialPlus_Support Hello, this is the display name used to filter “DE - Support - “.
We have a country like structure, where we group our conversation channels with a tag e.g. “de", “at”.
And we also have all the conversation channels start with the same display name per country.
So for Germany it would be “DE - Support - userName” where userName is the only different user per channel, and that channel would have the “de” tag.

If it helps the German filter has to go through a lot of channels, currently we have over 5000 channels just for that country.

And it works as expected but only for this one channel it is different, and the channel has all the required parameters.

Hello @Svrle , Thank you for the additional details.
We’ve reproduced the scenario following the same pattern you described, and we didn’t encounter the issue when performing an exact match search.

Could you please confirm whether you’re searching exactly as written (“DE - Support - …”) or using a different ordering or partial search?
If the search input isn’t in the same order, it may cause the channel not to appear in the results.

Thank you for your help in clarifying this. :folded_hands:

@SocialPlus_Support The search pattern is exactly as written “DE - Support - “.

Hello @Svrle , Thank you for confirming.

We’ve tested using the same version and followed the exact search pattern ("DE - Support - ") on our side, but we’re unable to reproduce the issue.

Could you please confirm if we’re reproducing the scenario the same way as you?
Any additional details such as steps, filters, or parameters would be very helpful for us to verify this further.


@SocialPlus_Support We also have the “*types: [“conversation”],” inside the filter.
*
This is our code for the most part

    useEffect(() => {




        const filter = {

            displayName: channelNamePrefill ? channelNamePrefill + searchQuery : undefined,

            types: ["conversation"],

            membership: "member",

            sortBy: "lastActivity",

            tags: [channelTag],

            limit: 20,

        }




        const unsubscriber = ChannelRepository.getChannels(

            filter,

            ({ data, onNextPage, hasNextPage, loading }) => {

                setLoading(loading);




                if (data.length) {

                    const filteredChannels = filterByQuery(data);

                    const sortedChannels = sortChannels(filteredChannels);




                    if (Array.isArray(data) && sortedChannels.length > userChannels.length) {

                        window.parent.postMessage({

                            action: "getUserChannels",

                            payload: {}

                        }, ApplicationSettings.administrationUrl)

                    }




                    setChannels(sortedChannels);

                }




                nextPageUtility.current.hasMore = hasNextPage;

                nextPageUtility.current.nextPage = onNextPage;

            }

        );




        return () => {

            unsubscriber();

            timer.current.clearTimer();

        };




    }, [searchQuery]); 

The window.parent.postMessage is just a way for us to sync the data we have in our DB with the data provided by the amity API.

Hello @Svrle , We’ve sent you an email regarding the additional information we need to continue investigating your reported issue.
Could you please kindly check your inbox at ivan.svrtan@gmail.com for our message?

Thank you for your cooperation and understanding.