Skip to content

Commit

Permalink
fix(antenna): src=list && userListId=null の場合クエリータイムアウトが発生する問題を修正 (Mi…
Browse files Browse the repository at this point in the history
…sskeyIO#721)

(cherry picked from commit 47b6b97)
  • Loading branch information
u1-liquid authored and kakkokari-gtyih committed Sep 17, 2024
1 parent 7d7a12d commit d49ac32
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/backend/src/core/AntennaService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,14 @@ export class AntennaService implements OnApplicationShutdown {
if (antenna.src === 'home') {
// TODO
} else if (antenna.src === 'list') {
const listUsers = (await this.userListMembershipsRepository.findBy({
userListId: antenna.userListId!,
})).map(x => x.userId);

if (!listUsers.includes(note.userId)) return false;
if (antenna.userListId == null) return false;
const exists = await this.userListMembershipsRepository.exists({
where: {
userListId: antenna.userListId,
userId: note.userId,
},
});
if (!exists) return false;
} else if (antenna.src === 'users') {
const accts = antenna.users.map(x => {
const { username, host } = Acct.parse(x);
Expand Down

0 comments on commit d49ac32

Please sign in to comment.