From 4395af5b2896b808c2c847c2a9be73b5cab4b892 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Fri, 17 Jul 2020 22:47:22 +0900 Subject: [PATCH] Ignore Activities from deleted actors on both ends Fix #6553 (#6554) --- src/queue/processors/inbox.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/queue/processors/inbox.ts b/src/queue/processors/inbox.ts index 8a292107b..1d35079e9 100644 --- a/src/queue/processors/inbox.ts +++ b/src/queue/processors/inbox.ts @@ -47,7 +47,15 @@ export default async (job: Bull.Job): Promise => { // keyIdでわからなければ、activity.actorを元にDBから取得 || activity.actorを元にリモートから取得 if (authUser == null) { - authUser = await dbResolver.getAuthUserFromApId(getApId(activity.actor)); + try { + authUser = await dbResolver.getAuthUserFromApId(getApId(activity.actor)); + } catch (e) { + // 対象が4xxならスキップ + if (e.statusCode >= 400 && e.statusCode < 500) { + return `skip: Ignored deleted actors on both ends ${activity.actor} - ${e.statusCode}`; + } + throw `Error in actor ${activity.actor} - ${e.statusCode || e}`; + } } // それでもわからなければ終了