I am trying to fetch all channels of a user(channel of which that user is a member). So, I got to know about this :
const filter = {
type: 'messaging',
members: { $in: [`${req.body.id}`] },
};
const sort = { last_message_at: -1 };
const channelList = await client.queryChannels(filter, sort, {
watch: true,
state: true,
});
, by sending current user id as req.body.id.I have made a separate function for it. And when the user enters that page, I need to call that function. But when I am doing this, I am getting this error as a response :
"StreamChat error code 4: QueryChannels failed with error: "Watch or Presence requires an active websocket connection, please make sure to include your websocket connection_id"
Please suggest whether I am doing anything wrong to fulfill this task or what I am doing wrong here.