summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/AccountUpdateService.ts
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-05-05 17:44:00 -0400
committerHazelnoot <acomputerdog@gmail.com>2025-05-07 12:40:01 -0400
commitc302a5c2d7696bc9dddeabe914b92ad2fdc0b0ba (patch)
treeabd55451e5defc2475123450ec5a2310048a1235 /packages/backend/src/core/AccountUpdateService.ts
parentmerge: Merge upstream 2025.4.1 (!955) (diff)
downloadsharkey-c302a5c2d7696bc9dddeabe914b92ad2fdc0b0ba.tar.gz
sharkey-c302a5c2d7696bc9dddeabe914b92ad2fdc0b0ba.tar.bz2
sharkey-c302a5c2d7696bc9dddeabe914b92ad2fdc0b0ba.zip
reorder relay activities to avoid delivery race condition
Diffstat (limited to 'packages/backend/src/core/AccountUpdateService.ts')
-rw-r--r--packages/backend/src/core/AccountUpdateService.ts9
1 files changed, 3 insertions, 6 deletions
diff --git a/packages/backend/src/core/AccountUpdateService.ts b/packages/backend/src/core/AccountUpdateService.ts
index 69a57b4854..ef2962fc12 100644
--- a/packages/backend/src/core/AccountUpdateService.ts
+++ b/packages/backend/src/core/AccountUpdateService.ts
@@ -27,15 +27,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');
-
+ public async publishToFollowers(user: MiUser) {
// フォロワーがリモートユーザーかつ投稿者がローカルユーザーならUpdateを配信
if (this.userEntityService.isLocalUser(user)) {
const content = this.apRendererService.addContext(this.apRendererService.renderUpdate(await this.apRendererService.renderPerson(user), user));
- this.apDeliverManagerService.deliverToFollowers(user, content);
- this.relayService.deliverToRelays(user, content);
+ await this.apDeliverManagerService.deliverToFollowers(user, content);
+ await this.relayService.deliverToRelays(user, content);
}
}
}