New attachment storage system

This commit is contained in:
Fedor Indutny
2024-07-11 12:44:09 -07:00
committed by GitHub
parent 273e1ccb15
commit 28664a606f
161 changed files with 2418 additions and 1562 deletions
+6
View File
@@ -171,6 +171,10 @@ export function convertBackupMessageAttachmentToAttachment(
async function generateNewEncryptionInfoForAttachment(
attachment: Readonly<LocallySavedAttachment>
): Promise<AttachmentReadyForBackup> {
strictAssert(
attachment.version !== 2,
'generateNewEncryptionInfoForAttachment can only be used on legacy attachments'
);
const fixedUpAttachment = { ...attachment };
// Since we are changing the encryption, we need to delete all encryption & location
@@ -195,6 +199,8 @@ async function generateNewEncryptionInfoForAttachment(
attachment.path
),
},
getAbsoluteAttachmentPath:
window.Signal.Migrations.getAbsoluteAttachmentPath,
});
return {