-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(server): DriveFile related N+1 query when call note packMany #10133
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #10133 +/- ##
===========================================
+ Coverage 25.06% 25.19% +0.13%
===========================================
Files 705 706 +1
Lines 65151 65281 +130
Branches 2307 2331 +24
===========================================
+ Hits 16329 16447 +118
- Misses 48822 48834 +12
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
is-not-nullで |
直した |
fileIds: DriveFile['id'][], | ||
options?: PackOptions, | ||
): Promise<Packed<'DriveFile'>[]> { | ||
const files = await this.driveFilesRepository.findBy({ id: In(fileIds) }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここって fileIds
の順序にソートしなくても良い?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
あ〜〜、確かにした方がいいな
🙏🙏 |
ファイル付きノートのRenoteをpackしたときに、場合によってはファイルが消えるわね |
@@ -388,11 +391,14 @@ export class NoteEntityService implements OnModuleInit { | |||
} | |||
|
|||
await this.customEmojiService.prefetchEmojis(this.customEmojiService.aggregateNoteEmojis(notes)); | |||
const fileIds = notes.flatMap(n => n.fileIds); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
多分ここでrenote(あとreply?)も考慮する必要がある
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
もしくは、_hint_に希望するファイルが含まれてなかったらスキップするのではなくて諦めてDBにfindしてくるようにするとか
Fix #10129