Add a new way to query all users
还没有人认领这个 Issue。
评估
调研方向
首先跟踪 query_channels 入口点以及 stream-chat==4.8.0 使用的 offset 和 limit 处理方式。检查链接的 Zendesk 指南,并复现 issue 中描述的分页循环;done 应提供一种有文档记录的方法,在不无限循环的情况下获取 offset 1000 之后的所有匹配用户或频道。
由索引模型根据 Issue 内容生成。
描述
Problem explanation
Zendesk ticket: 43044
query_channels possible infinite loop by always returning results over 1000
eg Asking for offset: 1000000 will return users even when only 2000 users may exist in the system.
I would suggest that the library implement an easy way to query all users with offsets greater than 1000, maybe a python iterable.
Steps to reproduce
I'm well aware this code is not very clean but it does show the issue. Since query channels will always return items in the array you don't know when to stop.
channels = []
offset = 0
limit = max_limit_to_fetch_channels
channels_fetched_count = limit
while channels_fetched_count > 0 or channels_fetched_count == limit:
channels_fetched = query_channels(
filter_conditions=......,
sort={"last_message_at": -1},
message_limit=1,
channel_limit=limit,
offset=offset,
)
channels.extend(channels_fetched)
offset += limit
channels_fetched_count = len(channels_fetched)
Environment info
Library version: stream-chat==4.8.0
- 主要语言
- Python
- 星标
- 73
- 派生
- 20
- 平均合并
- 11 小时 34 分钟
- 30 天内合并 PR
- 7
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
GetStream/stream-chat-python 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 35/100
GetStream/stream-chat-python#252 ·
-
难度 4/5 3-5 天 新手友好度 42/100
GetStream/stream-chat-python#244 ·
-
enhancement
难度 5/5 一周以上 新手友好度 25/100
GetStream/stream-chat-python#167 · 5 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
GetStream/stream-chat-python#166 · 2 条评论 ·
-
conda?未关闭
难度 5/5 一周以上 新手友好度 15/100
GetStream/stream-chat-python#152 ·
查看 GetStream/stream-chat-python 的全部 Issue
相似的 Issue
-
bug
难度 1/5 1 小时以内 新手友好度 85/100
NatLabRockies/openstudio-mcp#286 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
-
bug
难度 2/5 1-3 小时 新手友好度 65/100
intersystems/ipm#1338 ·
维护者通常 1 天内回复
-
separate_packages splits imports from the same explicitly configured package可能已有人在做 @rahul05ranjan 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 2 天内回复
-
The v0-through-v1 path derives ShutdownDuration its own way, silently overriding a user's definition未关闭v1
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复