From 0a4499fd039653dcce5a50023aff2d7b13a0a862 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 8a292107ba..1d35079e9d 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}`; + } } // それでもわからなければ終了