Merge branch 'master' into reenable-isolatedvm
This commit is contained in:
commit
b2caa1b787
|
@ -72,6 +72,9 @@ export class AttachmentCleanup {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
rows.forEach(row => {
|
rows.forEach(row => {
|
||||||
|
if (!Array.isArray(row[key])) {
|
||||||
|
return
|
||||||
|
}
|
||||||
files = files.concat(
|
files = files.concat(
|
||||||
row[key].map((attachment: any) => attachment.key)
|
row[key].map((attachment: any) => attachment.key)
|
||||||
)
|
)
|
||||||
|
|
|
@ -103,6 +103,14 @@ describe("attachment cleanup", () => {
|
||||||
expect(mockedDeleteFiles).toBeCalledWith(BUCKET, [FILE_NAME])
|
expect(mockedDeleteFiles).toBeCalledWith(BUCKET, [FILE_NAME])
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it("should handle row deletion and not throw when attachments are undefined", async () => {
|
||||||
|
await AttachmentCleanup.rowDelete(table(), [
|
||||||
|
{
|
||||||
|
attach: undefined,
|
||||||
|
},
|
||||||
|
])
|
||||||
|
})
|
||||||
|
|
||||||
it("shouldn't cleanup attachments if row not updated", async () => {
|
it("shouldn't cleanup attachments if row not updated", async () => {
|
||||||
await AttachmentCleanup.rowUpdate(table(), { row: row(), oldRow: row() })
|
await AttachmentCleanup.rowUpdate(table(), { row: row(), oldRow: row() })
|
||||||
expect(mockedDeleteFiles).not.toBeCalled()
|
expect(mockedDeleteFiles).not.toBeCalled()
|
||||||
|
|
|
@ -10763,7 +10763,7 @@ fetch-cookie@0.11.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
tough-cookie "^2.3.3 || ^3.0.1 || ^4.0.0"
|
tough-cookie "^2.3.3 || ^3.0.1 || ^4.0.0"
|
||||||
|
|
||||||
fflate@^0.4.1, fflate@^0.4.8:
|
fflate@^0.4.1:
|
||||||
version "0.4.8"
|
version "0.4.8"
|
||||||
resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.4.8.tgz#f90b82aefbd8ac174213abb338bd7ef848f0f5ae"
|
resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.4.8.tgz#f90b82aefbd8ac174213abb338bd7ef848f0f5ae"
|
||||||
integrity sha512-FJqqoDBR00Mdj9ppamLa/Y7vxm+PRmNWA67N846RvsoYVMKB4q3y/de5PA7gUmRMYK/8CMz2GDZQmCRN1wBcWA==
|
integrity sha512-FJqqoDBR00Mdj9ppamLa/Y7vxm+PRmNWA67N846RvsoYVMKB4q3y/de5PA7gUmRMYK/8CMz2GDZQmCRN1wBcWA==
|
||||||
|
|
Loading…
Reference in New Issue