1
0
Fork 0
mirror of synced 2024-07-15 11:15:59 +12:00

Merge branch 'master' into reenable-isolatedvm

This commit is contained in:
Adria Navarro 2024-02-19 12:27:45 +01:00 committed by GitHub
commit b2caa1b787
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 1 deletions

View file

@ -72,6 +72,9 @@ export class AttachmentCleanup {
continue
}
rows.forEach(row => {
if (!Array.isArray(row[key])) {
return
}
files = files.concat(
row[key].map((attachment: any) => attachment.key)
)

View file

@ -103,6 +103,14 @@ describe("attachment cleanup", () => {
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 () => {
await AttachmentCleanup.rowUpdate(table(), { row: row(), oldRow: row() })
expect(mockedDeleteFiles).not.toBeCalled()

View file

@ -10763,7 +10763,7 @@ fetch-cookie@0.11.0:
dependencies:
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"
resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.4.8.tgz#f90b82aefbd8ac174213abb338bd7ef848f0f5ae"
integrity sha512-FJqqoDBR00Mdj9ppamLa/Y7vxm+PRmNWA67N846RvsoYVMKB4q3y/de5PA7gUmRMYK/8CMz2GDZQmCRN1wBcWA==