Fix Empty Collection WHERE Filter Issue (#23086)
This commit is contained in:
parent
63b6026e6e
commit
47cc951841
5 changed files with 36 additions and 10 deletions
|
|
@ -111,7 +111,8 @@ class MessageService:
|
|||
|
||||
base_query = base_query.where(Message.conversation_id == conversation.id)
|
||||
|
||||
if include_ids is not None:
|
||||
# Check if include_ids is not None and not empty to avoid WHERE false condition
|
||||
if include_ids is not None and len(include_ids) > 0:
|
||||
base_query = base_query.where(Message.id.in_(include_ids))
|
||||
|
||||
if last_id:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue