From 7c5bc06bb8656f2a7eb4beb79398d97f9e1eb425 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Mon, 27 Nov 2023 22:28:15 +0100 Subject: [PATCH] [backend] Actually utilize packed user cache in notes.packMany --- packages/backend/src/models/repositories/note.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/models/repositories/note.ts b/packages/backend/src/models/repositories/note.ts index 2a3022380..7eda8d858 100644 --- a/packages/backend/src/models/repositories/note.ts +++ b/packages/backend/src/models/repositories/note.ts @@ -30,8 +30,6 @@ import { db } from "@/db/postgre.js"; import { IdentifiableError } from "@/misc/identifiable-error.js"; import { PackedUserCache } from "@/models/repositories/user.js"; import { isFiltered } from "@/misc/is-filtered.js"; -import { UserProfile } from "@/models/entities/user-profile.js"; -import { Cache } from "@/misc/cache.js"; export async function populatePoll(note: Note, meId: User["id"] | null) { const poll = await Polls.findOneByOrFail({ noteId: note.id }); @@ -330,6 +328,7 @@ export const NoteRepository = db.getRepository(Note).extend({ options?: { detail?: boolean; }, + userCache: PackedUserCache = Users.getFreshPackedUserCache(), ) { if (notes.length === 0) return []; @@ -377,7 +376,7 @@ export const NoteRepository = db.getRepository(Note).extend({ myReactions: myReactionsMap, myRenotes: myRenotesMap }, - }), + }, userCache), ), );