Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stream_chat/async_chat/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ async def query_reminders(
:return: API response with reminders
"""
params = options.copy()
params["filter_conditions"] = filter_conditions or {}
params["filter"] = filter_conditions or {}
Copy link

@10printhello 10printhello Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note: if you've renamed the param to filter here, should the func arg (filter_conditions) change also as the other args match the params (user_id & user_id etc)?

Appreciate this might be a breaking change which is why you haven't. Thought worth mentioning for consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same, i didn't want to change it as its a breaking change

params["sort"] = sort or [{"field": "remind_at", "direction": 1}]
params["user_id"] = user_id
return await self.post("reminders/query", data=params)
Expand Down
2 changes: 1 addition & 1 deletion stream_chat/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ def query_reminders(
:return: API response with reminders
"""
params = options.copy()
params["filter_conditions"] = filter_conditions or {}
params["filter"] = filter_conditions or {}
params["sort"] = sort or [{"field": "remind_at", "direction": 1}]
params["user_id"] = user_id
return self.post("reminders/query", data=params)
Expand Down
21 changes: 20 additions & 1 deletion stream_chat/tests/async_chat/test_reminders.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,30 @@ async def test_query_reminders(self, client: StreamChatAsync, channel, random_us
random_user["id"], filter_conditions
)
assert response is not None
assert "reminders" in response
# Verify all returned reminders match the filter
for reminder in response["reminders"]:
assert reminder["message_id"] in [message_ids[0]]

# Test case 3: Query reminders by channel CID
# Test case 3: Query reminders by single message ID
filter_conditions = {"message_id": message_ids[0]}
response = await client.query_reminders(random_user["id"], filter_conditions)
assert response is not None
assert "reminders" in response
assert len(response["reminders"]) >= 1
# Verify all returned reminders have the exact message_id
for reminder in response["reminders"]:
assert reminder["message_id"] == message_ids[0]

# Test case 4: Query reminders by channel CID
filter_conditions = {"channel_cid": channel_cid}
response = await client.query_reminders(random_user["id"], filter_conditions)
assert response is not None
assert "reminders" in response
assert len(response["reminders"]) >= 3
# Verify all returned reminders belong to the channel
for reminder in response["reminders"]:
assert reminder["channel_cid"] == channel_cid

# Clean up - try to delete the reminders
for message_id in message_ids:
Expand Down
21 changes: 20 additions & 1 deletion stream_chat/tests/test_reminders.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,30 @@ def test_query_reminders(self, client: StreamChat, channel, random_user):
filter_conditions = {"message_id": {"$in": [message_ids[0]]}}
response = client.query_reminders(random_user["id"], filter_conditions)
assert response is not None
assert "reminders" in response
# Verify all returned reminders match the filter
for reminder in response["reminders"]:
assert reminder["message_id"] in [message_ids[0]]

# Test case 3: Query reminders by channel CID
# Test case 3: Query reminders by single message ID
filter_conditions = {"message_id": message_ids[0]}
response = client.query_reminders(random_user["id"], filter_conditions)
assert response is not None
assert "reminders" in response
assert len(response["reminders"]) >= 1
# Verify all returned reminders have the exact message_id
for reminder in response["reminders"]:
assert reminder["message_id"] == message_ids[0]

# Test case 4: Query reminders by channel CID
filter_conditions = {"channel_cid": channel_cid}
response = client.query_reminders(random_user["id"], filter_conditions)
assert response is not None
assert "reminders" in response
assert len(response["reminders"]) >= 3
# Verify all returned reminders belong to the channel
for reminder in response["reminders"]:
assert reminder["channel_cid"] == channel_cid

# Clean up - try to delete the reminders
for message_id in message_ids:
Expand Down