Allow backfill for more undownloadable attachments
This commit is contained in:
parent
d69887a4f9
commit
427f91f903
8 changed files with 98 additions and 49 deletions
|
@ -17,6 +17,7 @@ import {
|
|||
mightBeOnBackupTier,
|
||||
type AttachmentType,
|
||||
AttachmentVariant,
|
||||
AttachmentPermanentlyUndownloadableError,
|
||||
} from '../types/Attachment';
|
||||
import * as Bytes from '../Bytes';
|
||||
import {
|
||||
|
@ -115,9 +116,13 @@ export async function downloadAttachment(
|
|||
|
||||
const { digest, incrementalMac, chunkSize, key, size } = attachment;
|
||||
|
||||
strictAssert(digest, `${logId}: missing digest`);
|
||||
strictAssert(key, `${logId}: missing key`);
|
||||
strictAssert(isNumber(size), `${logId}: missing size`);
|
||||
try {
|
||||
strictAssert(digest, `${logId}: missing digest`);
|
||||
strictAssert(key, `${logId}: missing key`);
|
||||
strictAssert(isNumber(size), `${logId}: missing size`);
|
||||
} catch (error) {
|
||||
throw new AttachmentPermanentlyUndownloadableError(error.message);
|
||||
}
|
||||
|
||||
const mediaTier =
|
||||
options?.mediaTier ??
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue