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