fix(backend): チャンネルミュートを有効にしている際にノートの閲覧ができなくなることがある問題を修正 (#17251)

* fix(backend): チャンネルミュート使用時にユーザーのノート一覧読み込みに失敗する問題を修正

* more fix

* Update Changelog
This commit is contained in:
かっこかり
2026-03-20 19:11:56 +09:00
committed by GitHub
parent 0e4732180f
commit 54e94263a8
4 changed files with 14 additions and 3 deletions

View File

@@ -10,6 +10,7 @@
- Fix: 自分の行ったフォロワー限定投稿または指名投稿に自分自身でリアクションなどを行った場合のイベントが流れない問題を修正 - Fix: 自分の行ったフォロワー限定投稿または指名投稿に自分自身でリアクションなどを行った場合のイベントが流れない問題を修正
- Fix: 署名付きGETリクエストにおいてAcceptヘッダを署名の対象から除外Acceptヘッダを正規化するCDNやリバースプロキシを使用している際に挙動がおかしくなる問題を修正 - Fix: 署名付きGETリクエストにおいてAcceptヘッダを署名の対象から除外Acceptヘッダを正規化するCDNやリバースプロキシを使用している際に挙動がおかしくなる問題を修正
- Fix: WebSocket接続におけるートの非表示ロジックを修正 - Fix: WebSocket接続におけるートの非表示ロジックを修正
- Fix: チャンネルミュートを有効にしている際に、一部のタイムラインやノート一覧が空になる問題を修正
## 2026.3.1 ## 2026.3.1

View File

@@ -15,6 +15,7 @@ import { FanoutTimelineEndpointService } from '@/core/FanoutTimelineEndpointServ
import { MiLocalUser } from '@/models/User.js'; import { MiLocalUser } from '@/models/User.js';
import { ChannelMutingService } from '@/core/ChannelMutingService.js'; import { ChannelMutingService } from '@/core/ChannelMutingService.js';
import { ApiError } from '../../error.js'; import { ApiError } from '../../error.js';
import { Brackets } from 'typeorm';
export const meta = { export const meta = {
tags: ['notes', 'channels'], tags: ['notes', 'channels'],
@@ -132,7 +133,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
.then(x => x.map(x => x.id).filter(x => x !== ps.channelId)); .then(x => x.map(x => x.id).filter(x => x !== ps.channelId));
if (mutingChannelIds.length > 0) { if (mutingChannelIds.length > 0) {
query.andWhere('note.channelId NOT IN (:...mutingChannelIds)', { mutingChannelIds }); query.andWhere('note.channelId NOT IN (:...mutingChannelIds)', { mutingChannelIds });
query.andWhere('note.renoteChannelId NOT IN (:...mutingChannelIds)', { mutingChannelIds }); query.andWhere(new Brackets(qb => {
qb.orWhere('note.renoteChannelId IS NULL');
qb.orWhere('note.renoteChannelId NOT IN (:...mutingChannelIds)', { mutingChannelIds });
}));
} }
} }
//#endregion //#endregion

View File

@@ -177,7 +177,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
.andWhere('note.channelId IS NULL') .andWhere('note.channelId IS NULL')
.andWhere('note.userId IN (:...meOrFolloweeIds)', { meOrFolloweeIds: meOrFolloweeIds }); .andWhere('note.userId IN (:...meOrFolloweeIds)', { meOrFolloweeIds: meOrFolloweeIds });
if (mutingChannelIds.length > 0) { if (mutingChannelIds.length > 0) {
qb.andWhere('note.renoteChannelId NOT IN (:...mutingChannelIds)', { mutingChannelIds }); qb.andWhere(new Brackets(qb2 => {
qb2.orWhere('note.renoteChannelId IS NULL');
qb2.orWhere('note.renoteChannelId NOT IN (:...mutingChannelIds)', { mutingChannelIds });
}));
} }
})); }));
} else if (followingChannelIds.length > 0) { } else if (followingChannelIds.length > 0) {

View File

@@ -185,7 +185,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
if (ps.withChannelNotes) { if (ps.withChannelNotes) {
query.andWhere(new Brackets(qb => { query.andWhere(new Brackets(qb => {
if (mutingChannelIds.length > 0) { if (mutingChannelIds.length > 0) {
qb.andWhere('note.channelId NOT IN (:...mutingChannelIds)', { mutingChannelIds: mutingChannelIds }); qb.andWhere(new Brackets(qb2 => {
qb2.orWhere('note.channelId IS NULL');
qb2.orWhere('note.channelId NOT IN (:...mutingChannelIds)', { mutingChannelIds });
}));
} }
if (!isSelf) { if (!isSelf) {