Bug:

未关闭
#136 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python
领域
api

调研方向

使用 issue 中所示的 client.search 调用,复现使用不存在的频道 ID 时出现的失败。从 stream_chat/client.py 开始,重点检查 search 以及 _parse_response 中的响应路径,并确定应在何处处理空结果行为。完成的标准是同一个搜索返回空列表,而不是 StreamAPIException。

由索引模型根据 Issue 内容生成。

描述

When I use the client.search function for some channels ids which doesn't exist, instead of returning an empty list it gives me the following error:

Traceback (most recent call last):
  File "senti_abuse_analysis.py", line 177, in <module>
    response = client.search({"id": {"$in": channel_ids}}, {"updated_at":{"$gt": previous_max_date}}, limit=400)
  File "/home/ec2-user/anaconda3/envs/pytorch_latest_p36/lib/python3.6/site-packages/stream_chat/client.py", line 358, in search
    return self.get("search", params={"payload": json.dumps(params)})
  File "/home/ec2-user/anaconda3/envs/pytorch_latest_p36/lib/python3.6/site-packages/stream_chat/client.py", line 90, in get
    return self._make_request(self.session.get, relative_url, params, None)
  File "/home/ec2-user/anaconda3/envs/pytorch_latest_p36/lib/python3.6/site-packages/stream_chat/client.py", line 77, in _make_request
    return self._parse_response(response)
  File "/home/ec2-user/anaconda3/envs/pytorch_latest_p36/lib/python3.6/site-packages/stream_chat/client.py", line 46, in _parse_response
    raise StreamAPIException(response.text, response.status_code)
stream_chat.base.exceptions.StreamAPIException: StreamChat error code 4: Search failed with error: "There are no searchable channels""
主要语言
Python
星标
73
派生
20
平均合并
11 小时 34 分钟
30 天内合并 PR
7

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

GetStream/stream-chat-python 的其他 Issue

查看 GetStream/stream-chat-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。