getOlderMessagesByConversation: Allow falsey messageId for resiliency

This commit is contained in:
Scott Nonnenberg 2020-08-27 18:21:29 -07:00 committed by Josh Perez
parent 036ce0a6d9
commit f5a3fdb174

View file

@ -2655,10 +2655,6 @@ async function getOlderMessagesByConversation(
messageId,
}: { limit?: number; receivedAt?: number; messageId?: string } = {}
) {
if (receivedAt !== Number.MAX_VALUE && !messageId) {
throw new Error('If receivedAt is supplied, messageId should be as well');
}
const db = getInstance();
let rows;