Ensure old attachments with .id field only are handled
This commit is contained in:
parent
a0e9791623
commit
aaa91c441b
2 changed files with 5 additions and 1 deletions
|
@ -188,6 +188,10 @@ async function _runJob(job) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (attachment.id) {
|
||||||
|
// eslint-disable-next-line no-param-reassign
|
||||||
|
attachment.cdnId = attachment.id;
|
||||||
|
}
|
||||||
downloaded = await messageReceiver.downloadAttachment(attachment);
|
downloaded = await messageReceiver.downloadAttachment(attachment);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Attachments on the server expire after 30 days, then start returning 404
|
// Attachments on the server expire after 30 days, then start returning 404
|
||||||
|
|
|
@ -387,7 +387,7 @@ function _getExportAttachmentFileName(message, index, attachment) {
|
||||||
return _trimFileName(attachment.fileName);
|
return _trimFileName(attachment.fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
let name = attachment.cdnId || attachment.cdnKey;
|
let name = attachment.cdnId || attachment.cdnKey || attachment.id;
|
||||||
|
|
||||||
if (attachment.contentType) {
|
if (attachment.contentType) {
|
||||||
const components = attachment.contentType.split('/');
|
const components = attachment.contentType.split('/');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue