diff options
| author | Marie <github@yuugi.dev> | 2025-05-08 09:17:07 +0000 |
|---|---|---|
| committer | Marie <github@yuugi.dev> | 2025-05-08 09:17:07 +0000 |
| commit | a72610c8d6b9dba03a0270f6c9aa86c76cbb8bd9 (patch) | |
| tree | ee30fb9fbe48e0b4711e3cd51f4484e9aac0ce66 /packages/backend/src/core/AccountUpdateService.ts | |
| parent | merge: Respect "enable favicon notification dot" setting (resolves #1048) (!988) (diff) | |
| parent | reorder relay activities to avoid delivery race condition (diff) | |
| download | sharkey-a72610c8d6b9dba03a0270f6c9aa86c76cbb8bd9.tar.gz sharkey-a72610c8d6b9dba03a0270f6c9aa86c76cbb8bd9.tar.bz2 sharkey-a72610c8d6b9dba03a0270f6c9aa86c76cbb8bd9.zip | |
merge: Reorder relay activities to avoid delivery race condition (resolves #989) (!986)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/986
Closes #989
Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Marie <github@yuugi.dev>
Diffstat (limited to 'packages/backend/src/core/AccountUpdateService.ts')
| -rw-r--r-- | packages/backend/src/core/AccountUpdateService.ts | 9 |
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); } } } |