packages/django-channels-postgres/layer: fix query when subscribed to multiple channels (cherry-pick #18152 to version-2025.10) (#18153)

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

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
Co-authored-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
authentik-automation[bot]
2025-11-14 19:41:12 +01:00
committed by GitHub
parent 445fa31b57
commit db35593b24
@@ -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