refactor(federation): Inboxのエラーハンドリングの仕様変更 (#13610)

Cherry-picked from 89b27d8587221a321b6ff9cdae4b714bbedd151a

Co-authored-by: tamaina <tamaina@hotmail.co.jp>
This commit is contained in:
tamaina 2024-05-28 14:36:06 +09:00 committed by あわわわとーにゅ
parent 303a52160c
commit 25e24b053a
No known key found for this signature in database
GPG key ID: 6AFBBF529601C1DB
4 changed files with 84 additions and 59 deletions

View file

@ -198,7 +198,11 @@ export class InboxProcessorService implements OnApplicationShutdown {
// アクティビティを処理
try {
await this.apInboxService.performActivity(authUser.user, activity, job.data.user?.id);
const result = await this.apInboxService.performActivity(authUser.user, activity, job.data.user?.id);
if (result && !result.startsWith('ok')) {
this.logger.warn(`inbox activity ignored (maybe): id=${activity.id} reason=${result}`);
return result;
}
} catch (e) {
if (e instanceof IdentifiableError) {
if ([
@ -206,6 +210,7 @@ export class InboxProcessorService implements OnApplicationShutdown {
'689ee33f-f97c-479a-ac49-1b9f8140af99',
'9f466dab-c856-48cd-9e65-ff90ff750580',
'85ab9bd7-3a41-4530-959d-f07073900109',
'd450b8a9-48e4-4dab-ae36-f4db763fda7c',
].includes(e.id)) return e.message;
}
throw e;