Additional logging, more reliable contact/group sync fetch

This commit is contained in:
Scott Nonnenberg 2023-06-14 13:51:49 -07:00 committed by GitHub
parent 8e1a30d720
commit efc237d106
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 86 additions and 16 deletions

View file

@ -15,7 +15,11 @@ import type { WebAPIType } from './WebAPI';
export async function downloadAttachment(
server: WebAPIType,
attachment: ProcessedAttachment
attachment: ProcessedAttachment,
options?: {
disableRetries?: boolean;
timeout?: number;
}
): Promise<DownloadedAttachmentType> {
const cdnId = attachment.cdnId || attachment.cdnKey;
const { cdnNumber } = attachment;
@ -25,7 +29,11 @@ export async function downloadAttachment(
}
strictAssert(cdnId, 'attachment without cdnId');
const encrypted = await server.getAttachment(cdnId, dropNull(cdnNumber));
const encrypted = await server.getAttachment(
cdnId,
dropNull(cdnNumber),
options
);
const { key, digest, size, contentType } = attachment;
if (!digest) {