Also use sent_at whenever we query database with received_at
This commit is contained in:
@@ -673,6 +673,7 @@ async function exportConversation(conversation, options = {}) {
|
||||
|
||||
// We're looping from the most recent to the oldest
|
||||
let lastReceivedAt = Number.MAX_VALUE;
|
||||
let lastSentAt = Number.MAX_VALUE;
|
||||
|
||||
while (!complete) {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
@@ -681,6 +682,7 @@ async function exportConversation(conversation, options = {}) {
|
||||
{
|
||||
limit: CHUNK_SIZE,
|
||||
receivedAt: lastReceivedAt,
|
||||
sentAt: lastSentAt,
|
||||
MessageCollection: Whisper.MessageCollection,
|
||||
}
|
||||
);
|
||||
@@ -771,6 +773,7 @@ async function exportConversation(conversation, options = {}) {
|
||||
const last = messages.length > 0 ? messages[messages.length - 1] : null;
|
||||
if (last) {
|
||||
lastReceivedAt = last.received_at;
|
||||
lastSentAt = last.sent_at;
|
||||
}
|
||||
|
||||
if (messages.length < CHUNK_SIZE) {
|
||||
|
Reference in New Issue
Block a user