Ensure getLastConversationPreview never returns expired messages

This commit is contained in:
Evan Hahn 2021-09-20 12:57:59 -05:00 committed by GitHub
parent 1b9d8dcb11
commit 48daaaa81d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4816,6 +4816,10 @@ function getLastConversationPreview({
SELECT json FROM messages
WHERE
conversationId = $conversationId AND
(
expiresAt IS NULL OR
(expiresAt > $now)
) AND
(
type IS NULL
OR
@ -4841,6 +4845,7 @@ function getLastConversationPreview({
).get({
conversationId,
ourConversationId,
now: Date.now(),
});
if (!row) {