packages/django-channels-postgres/layer: fix query when subscribed to multiple channels (#18152)

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
Marc 'risson' Schmitt
2025-11-14 15:30:19 +01:00
committed by GitHub
parent 5389709ab7
commit 779d98a808
@@ -473,7 +473,7 @@ class PostgresChannelLayerReceiver:
"""
DELETE
FROM {table}
WHERE {table}.{channel} IN (%s)
WHERE {table}.{channel} = ANY(%s)
AND {table}.{expires} >= %s
RETURNING {table}.{id}, {table}.{channel}, {table}.{message}
"""
@@ -484,7 +484,7 @@ class PostgresChannelLayerReceiver:
expires=sql.Identifier("expires"),
message=sql.Identifier("message"),
),
(tuple(self._subscribed_to), now()),
(list(self._subscribed_to), now()),
)
async for row in cursor:
message_id, channel, message = row