From 37658f51624e848c823d5867ad966e55ef37f407 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Sun, 24 Sep 2023 16:29:27 +0200 Subject: [PATCH] server: try to fix queue errors Some errors in the queue are not properly handled. For example a blocked instance will cause the respective queue job to be retried. this should of course not happen and instead the job should be dropped. This is trying to correct that. Changelog: Fixed --- packages/backend/src/queue/processors/inbox.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/backend/src/queue/processors/inbox.ts b/packages/backend/src/queue/processors/inbox.ts index d9e1fdee5..5e80af8aa 100644 --- a/packages/backend/src/queue/processors/inbox.ts +++ b/packages/backend/src/queue/processors/inbox.ts @@ -41,13 +41,15 @@ export default async (job: Bull.Job): Promise => { return `skip: unsupported LD-signature type ${activity.signature.type}`; } - // get user based on LD-Signature key id. - // lets assume that the creator has this common form: - // - // Then we can use it as the key id and (without fragment part) user id. - authUser = await getAuthUser(activity.signature.creator, activity.signature.creator.replace(/#.*$/, ''), resolver); + try { + // get user based on LD-Signature key id. + // lets assume that the creator has this common form: + // + // Then we can use it as the key id and (without fragment part) user id. + authUser = await getAuthUser(activity.signature.creator, activity.signature.creator.replace(/#.*$/, ''), resolver); - if (authUser == null) { + if (authUser == null) throw new Error(); + } catch { return 'skip: failed to resolve LD-Signature user'; }