fix: include local user itself
This commit is contained in:
parent
dbea0ee6fd
commit
6c0c6c7ad7
2 changed files with 8 additions and 5 deletions
|
@ -116,7 +116,7 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||||
UserBlockedCache.init(user.id).then((cache) => cache.getAll()),
|
UserBlockedCache.init(user.id).then((cache) => cache.getAll()),
|
||||||
RenoteMutingsCache.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) =>
|
const optFilter = (n: ScyllaNote) =>
|
||||||
!n.renoteId || !!n.text || n.files.length > 0 || n.hasPoll;
|
!n.renoteId || !!n.text || n.files.length > 0 || n.hasPoll;
|
||||||
|
|
||||||
|
@ -154,10 +154,9 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||||
|
|
||||||
const foundPacked = [];
|
const foundPacked = [];
|
||||||
while (foundPacked.length < ps.limit) {
|
while (foundPacked.length < ps.limit) {
|
||||||
const foundNotes = (await execNotePaginationQuery("home", ps, filter, user.id)).slice(
|
const foundNotes = (
|
||||||
0,
|
await execNotePaginationQuery("home", ps, filter, user.id)
|
||||||
ps.limit * 1.5,
|
).slice(0, ps.limit * 1.5); // Some may filtered out by Notes.packMany, thus we take more than ps.limit.
|
||||||
); // Some may filtered out by Notes.packMany, thus we take more than ps.limit.
|
|
||||||
foundPacked.push(
|
foundPacked.push(
|
||||||
...(await Notes.packMany(foundNotes, user, { scyllaNote: true })),
|
...(await Notes.packMany(foundNotes, user, { scyllaNote: true })),
|
||||||
);
|
);
|
||||||
|
|
|
@ -845,6 +845,10 @@ async function insertNote(
|
||||||
const localFollowers = await LocalFollowersCache.init(user.id).then(
|
const localFollowers = await LocalFollowersCache.init(user.id).then(
|
||||||
(cache) => cache.getAll(),
|
(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
|
// Do not issue BATCH because different queries of inserting post to home timelines involve different partitions
|
||||||
for (const follower of localFollowers) {
|
for (const follower of localFollowers) {
|
||||||
// no need to wait
|
// no need to wait
|
||||||
|
|
Loading…
Reference in a new issue