Fix duplicate messages at backup page boundaries

Co-authored-by: Rolfe Schmidt <141083381+rolfe-signal@users.noreply.github.com>
This commit is contained in:
automated-signal
2026-09-04 18:31:17 +00:00
committed by GitHub
co-authored by Rolfe Schmidt
parent f1c4f8cbc7
commit cb87fc33f2
3 changed files with 130 additions and 3 deletions
+3 -2
View File
@@ -9186,7 +9186,8 @@ function pageBackupMessages(
${MESSAGE_COLUMNS_FRAGMENT}
FROM messages
WHERE
rowid >= ${cursor?.nextRowid ?? 0}
rowid > ${cursor?.lastRowId ?? 0}
ORDER BY rowid ASC
LIMIT ${LIMIT}
`;
const rows: Array<MessageTypeUnhydrated & { rowid: number }> = db
@@ -9194,7 +9195,7 @@ function pageBackupMessages(
.all(params);
return {
cursor: {
nextRowid: rows.at(-1)?.rowid ?? 0,
lastRowId: rows.at(-1)?.rowid ?? 0,
done: rows.length < LIMIT,
} as PageBackupMessagesCursorType,
messages: hydrateMessages(db, rows),