From b55b48d57e93def205d4c5c3b9387fdf4c2557d7 Mon Sep 17 00:00:00 2001 From: tamaina Date: Thu, 24 Jul 2025 10:12:14 +0900 Subject: [PATCH] update AccountUpdateService --- packages/backend/src/core/AccountUpdateService.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/core/AccountUpdateService.ts b/packages/backend/src/core/AccountUpdateService.ts index 74f7f0fcab..bdbcc3fd1f 100644 --- a/packages/backend/src/core/AccountUpdateService.ts +++ b/packages/backend/src/core/AccountUpdateService.ts @@ -37,9 +37,12 @@ export class AccountUpdateService { @bindThis public async publishToFollowers(userId: MiUser['id']) { const user = await this.usersRepository.findOneBy({ id: userId }); - if (user == null) throw new Error('user not found'); + if (user == null || user.isDeleted) { + // ユーザーが存在しない、または削除されている場合は何もしない + return; + } - // 投稿者がローカルユーザーならUpdateを配信 + // ローカルユーザーならUpdateを配信 if (this.userEntityService.isLocalUser(user)) { const content = await this.createUpdatePersonActivity(user); this.apDeliverManagerService.deliverToFollowers(user, content); @@ -50,9 +53,12 @@ export class AccountUpdateService { @bindThis async publishToFollowersAndSharedInboxAndRelays(userId: MiUser['id']) { const user = await this.usersRepository.findOneBy({ id: userId }); - if (user == null) throw new Error('user not found'); + if (user == null || user.isDeleted) { + // ユーザーが存在しない、または削除されている場合は何もしない + return; + } - // 投稿者がローカルユーザーならUpdateを配信 + // ローカルユーザーならUpdateを配信 if (this.userEntityService.isLocalUser(user)) { const content = await this.createUpdatePersonActivity(user); const manager = this.apDeliverManagerService.createDeliverManager(user, content);