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 天內回覆