Download attachments in separate queue from message processing
This commit is contained in:
parent
a43a78731a
commit
1d2c3ae23c
34 changed files with 2062 additions and 214 deletions
|
@ -575,17 +575,22 @@ describe('Message', () => {
|
|||
body: 'hey there!',
|
||||
quote: {
|
||||
text: 'hey!',
|
||||
attachments: [],
|
||||
attachments: [
|
||||
{
|
||||
fileName: 'manifesto.txt',
|
||||
contentType: 'text/plain',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
const result = await upgradeVersion(message, { logger });
|
||||
assert.deepEqual(result, message);
|
||||
});
|
||||
|
||||
it('eliminates thumbnails with no data field', async () => {
|
||||
it('does not eliminate thumbnails with missing data field', async () => {
|
||||
const upgradeAttachment = sinon
|
||||
.stub()
|
||||
.throws(new Error("Shouldn't be called"));
|
||||
.returns({ fileName: 'processed!' });
|
||||
const upgradeVersion = Message._mapQuotedAttachments(upgradeAttachment);
|
||||
|
||||
const message = {
|
||||
|
@ -597,7 +602,7 @@ describe('Message', () => {
|
|||
fileName: 'cat.gif',
|
||||
contentType: 'image/gif',
|
||||
thumbnail: {
|
||||
fileName: 'failed to download!',
|
||||
fileName: 'not yet downloaded!',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
@ -611,6 +616,9 @@ describe('Message', () => {
|
|||
{
|
||||
contentType: 'image/gif',
|
||||
fileName: 'cat.gif',
|
||||
thumbnail: {
|
||||
fileName: 'processed!',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue