diff --git a/packages/backend/src/server/api/endpoints/notes/timeline.ts b/packages/backend/src/server/api/endpoints/notes/timeline.ts index a79d2dc46a..f898ea1040 100644 --- a/packages/backend/src/server/api/endpoints/notes/timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/timeline.ts @@ -116,7 +116,7 @@ export default define(meta, paramDef, async (ps, user) => { UserBlockedCache.init(user.id).then((cache) => cache.getAll()), RenoteMutingsCache.init(user.id).then((cache) => cache.getAll()), ]); - const validUserIds = [user.id].concat(followingUserIds); + const validUserIds = [user.id, ...followingUserIds]; const optFilter = (n: ScyllaNote) => !n.renoteId || !!n.text || n.files.length > 0 || n.hasPoll; @@ -154,10 +154,9 @@ export default define(meta, paramDef, async (ps, user) => { const foundPacked = []; while (foundPacked.length < ps.limit) { - const foundNotes = (await execNotePaginationQuery("home", ps, filter, user.id)).slice( - 0, - ps.limit * 1.5, - ); // Some may filtered out by Notes.packMany, thus we take more than ps.limit. + const foundNotes = ( + await execNotePaginationQuery("home", ps, filter, user.id) + ).slice(0, ps.limit * 1.5); // Some may filtered out by Notes.packMany, thus we take more than ps.limit. foundPacked.push( ...(await Notes.packMany(foundNotes, user, { scyllaNote: true })), ); diff --git a/packages/backend/src/services/note/create.ts b/packages/backend/src/services/note/create.ts index bea04da30a..1c9d4ce775 100644 --- a/packages/backend/src/services/note/create.ts +++ b/packages/backend/src/services/note/create.ts @@ -845,6 +845,10 @@ async function insertNote( const localFollowers = await LocalFollowersCache.init(user.id).then( (cache) => cache.getAll(), ); + if (Users.isLocalUser(user)) { + // Include the local user itself + localFollowers.push(user.id); + } // Do not issue BATCH because different queries of inserting post to home timelines involve different partitions for (const follower of localFollowers) { // no need to wait