mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
Enable backfilling of attachments without message_attachment rows
This commit is contained in:
@@ -705,6 +705,8 @@ export const DataWriter: ServerWritableInterface = {
|
||||
disableFSync,
|
||||
enableFSyncAndCheckpoint,
|
||||
|
||||
_testOnlyRemoveMessageAttachments,
|
||||
|
||||
// Server-only
|
||||
|
||||
removeKnownStickers,
|
||||
@@ -2720,6 +2722,17 @@ function saveMessageAttachment({
|
||||
).run(values);
|
||||
}
|
||||
|
||||
function _testOnlyRemoveMessageAttachments(
|
||||
db: WritableDB,
|
||||
timestamp: number
|
||||
): void {
|
||||
const [query, params] = sql`
|
||||
DELETE FROM message_attachments
|
||||
WHERE sentAt = ${timestamp};`;
|
||||
|
||||
db.prepare(query).run(params);
|
||||
}
|
||||
|
||||
function saveMessage(
|
||||
db: WritableDB,
|
||||
message: ReadonlyDeep<MessageType>,
|
||||
|
||||
Reference in New Issue
Block a user