From f99e8b372661da881d5b1b69be251c53087b7fba Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Mon, 3 Jul 2023 10:29:52 -0700 Subject: [PATCH] fix: :zap: immediately fail jobs with invalid signature --- packages/backend/src/queue/processors/inbox.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/queue/processors/inbox.ts b/packages/backend/src/queue/processors/inbox.ts index b319fbd38..09a69b25c 100644 --- a/packages/backend/src/queue/processors/inbox.ts +++ b/packages/backend/src/queue/processors/inbox.ts @@ -35,8 +35,11 @@ export default async (job: Bull.Job): Promise => { info["@context"] = undefined; logger.debug(JSON.stringify(info, null, 2)); - if (!signature?.keyId) return `Invalid signature: ${signature}`; - + if (!signature?.keyId) { + const err = `Invalid signature: ${signature}`; + job.moveToFailed({message: err}); + return err; + } //#endregion const host = toPuny(new URL(signature.keyId).hostname);