Improve ref counting when deduplicating attachments on disk

This commit is contained in:
trevor-signal
2026-02-12 17:34:12 -05:00
committed by GitHub
parent ef9e437362
commit ffd962fd50
11 changed files with 374 additions and 53 deletions

View File

@@ -30,10 +30,12 @@ type AttachmentDataToBeReused = WithRequiredProperties<
export async function getExistingAttachmentDataForReuse({
plaintextHash,
contentType,
messageId,
logId,
}: {
plaintextHash: string;
contentType: MIMEType;
messageId: string;
logId?: string;
}): Promise<AttachmentDataToBeReused | null> {
const existingAttachmentData =
@@ -41,6 +43,7 @@ export async function getExistingAttachmentDataForReuse({
plaintextHash,
version: CURRENT_ATTACHMENT_VERSION,
contentType,
messageId,
});
if (!existingAttachmentData) {