diff options
| author | dakkar <dakkar@thenautilus.net> | 2025-02-16 13:39:27 +0000 |
|---|---|---|
| committer | dakkar <dakkar@thenautilus.net> | 2025-02-16 13:39:27 +0000 |
| commit | e5c41444e69fddccf62a4b3d3a9bb3feb3157869 (patch) | |
| tree | 47f6e8ea20f5ada3a87ee728baa22020a7306a90 /packages/backend/src | |
| parent | merge: Enhance: Increase nodejs memory limit for docker (!899) (diff) | |
| parent | fill `myReaction` in more cases - may fix !944 (diff) | |
| download | sharkey-e5c41444e69fddccf62a4b3d3a9bb3feb3157869.tar.gz sharkey-e5c41444e69fddccf62a4b3d3a9bb3feb3157869.tar.bz2 sharkey-e5c41444e69fddccf62a4b3d3a9bb3feb3157869.zip | |
merge: fill `myReaction` in more cases - may fix #944 (!907)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/907
Closes #944
Approved-by: Charlotte <timo.herngreen@gmail.com>
Approved-by: Hazelnoot <acomputerdog@gmail.com>
Diffstat (limited to 'packages/backend/src')
| -rw-r--r-- | packages/backend/src/core/entities/NoteEntityService.ts | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/packages/backend/src/core/entities/NoteEntityService.ts b/packages/backend/src/core/entities/NoteEntityService.ts index be45e75d74..b3cd191ad2 100644 --- a/packages/backend/src/core/entities/NoteEntityService.ts +++ b/packages/backend/src/core/entities/NoteEntityService.ts @@ -42,8 +42,14 @@ function getAppearNoteIds(notes: MiNote[]): Set<string> { for (const note of notes) { if (isPureRenote(note)) { appearNoteIds.add(note.renoteId); + if (note.renote?.replyId) { + appearNoteIds.add(note.renote.replyId); + } } else { appearNoteIds.add(note.id); + if (note.replyId) { + appearNoteIds.add(note.replyId); + } } } return appearNoteIds; @@ -272,7 +278,9 @@ export class NoteEntityService implements OnModuleInit { const reaction = _hint_.myReactions.get(note.id); if (reaction) { return this.reactionService.convertLegacyReaction(reaction); - } else { + } else if (reaction === null) { + // the hints explicitly say this note has no reactions from + // this user return undefined; } } @@ -525,9 +533,6 @@ export class NoteEntityService implements OnModuleInit { if (meId) { const idsNeedFetchMyReaction = new Set<MiNote['id']>(); - // パフォーマンスのためノートが作成されてから2秒以上経っていない場合はリアクションを取得しない - const oldId = this.idService.gen(Date.now() - 2000); - const targetNotes: MiNote[] = []; for (const note of notes) { if (isPureRenote(note)) { @@ -537,15 +542,13 @@ export class NoteEntityService implements OnModuleInit { // idem if the renote is also a reply. targetNotes.push(note.renote.reply); } - } else if (note.reply) { - // idem for OP of a regular reply. - targetNotes.push(note.reply); } else { - if (note.id < oldId) { - targetNotes.push(note); - } else { - myReactionsMap.set(note.id, null); + if (note.reply) { + // idem for OP of a regular reply. + targetNotes.push(note.reply); } + + targetNotes.push(note); } } |