stream-chat-js
stream-chat-js copied to clipboard
User search doesn't work for large channels
User search doesn't work for channels with a lot of users Code sample:
import {
UserItem,
useChatContext,
useChannelStateContext,
} from 'stream-chat-react';
...
const { client, mutes } =
useChatContext<StreamChatGenerics>('useUserTrigger');
...
const { users } = await client.queryUsers(
{
name: { $autocomplete: query },
...mentionQueryParams.filters,
},
{ id: 1, ...mentionQueryParams.sort },
{ limit: 10, ...mentionQueryParams.options }
);
https://github.com/GetStream/stream-chat-js/assets/125695013/6dbc362c-4073-409f-a481-299eb5ae1fb4
copied request as curl:
curl 'https://chat.stream-io-api.com/users?user_id=fbf9d893-30c8-4c8b-ab24-0e75dbd7faff&connection_id=648cb067-0a05-4556-0000-000003656ef2&api_key=ursg4quw9ha4&payload=%7B%22filter_conditions%22:%7B%22name%22:%7B%22$autocomplete%22:%22myk%22%7D,%22teams%22:%7B%22$contains%22:%22786ef3ed-47e0-4b96-8d34-6855c580d904%22%7D%7D,%22sort%22:\[%7B%22field%22:%22id%22,%22direction%22:1%7D\],%22presence%22:false,%22limit%22:10%7D' \
-H 'authority: chat.stream-io-api.com' \
-H 'accept: application/json, text/plain, */*' \
-H 'accept-language: en-GB,en-US;q=0.9,en;q=0.8,uk;q=0.7,ru;q=0.6' \
-H 'authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiZmJmOWQ4OTMtMzBjOC00YzhiLWFiMjQtMGU3NWRiZDdmYWZmIiwiZXhwIjoxNjk1MjAwNDg3LCJpYXQiOjE2OTUwMjc2ODd9.uPxBvUs4rqXwgb_YpvIbc4oGTOVCCJZ8-nFTWq48J_8' \
-H 'cache-control: no-cache' \
-H 'origin: https://dev.venues.vimeows.com' \
-H 'pragma: no-cache' \
-H 'referer: https://dev.venues.vimeows.com/' \
-H 'sec-ch-ua: "Chromium";v="116", "Not)A;Brand";v="24", "Google Chrome";v="116"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
-H 'sec-fetch-dest: empty' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-site: cross-site' \
-H 'stream-auth-type: jwt' \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36' \
-H 'x-client-request-id: 4631ec0d-52fa-4a4c-9aab-cc6d7160ad58' \
-H 'x-stream-client: stream-chat-react-10.9.1-stream-chat-javascript-client-browser-8.11.0' \
--compressed
in small channels (with small amount of users) these requests don't fail
Request routed into ZenDesk