From bd5f25c678373175b5552e2fac4f0c44b31b1fb4 Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Sun, 22 Sep 2024 18:40:05 +0900 Subject: [PATCH] fix rbt bug? --- packages/backend/src/core/ReactionService.ts | 1 + packages/backend/src/core/entities/NoteEntityService.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/core/ReactionService.ts b/packages/backend/src/core/ReactionService.ts index f0a2876450..062d64f46b 100644 --- a/packages/backend/src/core/ReactionService.ts +++ b/packages/backend/src/core/ReactionService.ts @@ -337,6 +337,7 @@ export class ReactionService { //#endregion } + // TODO: 廃止 /** * 文字列タイプのレガシーな形式のリアクションを現在の形式に変換しつつ、 * データベース上には存在する「0個のリアクションがついている」という情報を削除する。 diff --git a/packages/backend/src/core/entities/NoteEntityService.ts b/packages/backend/src/core/entities/NoteEntityService.ts index 65a47d7591..ddc7f0aa38 100644 --- a/packages/backend/src/core/entities/NoteEntityService.ts +++ b/packages/backend/src/core/entities/NoteEntityService.ts @@ -329,7 +329,7 @@ export class NoteEntityService implements OnModuleInit { : this.meta.enableReactionsBuffering ? await this.reactionsBufferingService.get(note.id) : { deltas: {}, pairs: [] }; - const reactions = mergeReactions(note.reactions, bufferdReactions.deltas ?? {}); + const reactions = mergeReactions(this.reactionService.convertLegacyReactions(note.reactions), bufferdReactions.deltas ?? {}); for (const [name, count] of Object.entries(reactions)) { if (count <= 0) { delete reactions[name];