From 252efe8252ce5555ebc79b6a348610e9a37d9152 Mon Sep 17 00:00:00 2001 From: yukineko <27853966+hideki0403@users.noreply.github.com> Date: Fri, 24 Nov 2023 20:19:46 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=89=B9=E5=AE=9A=E3=81=AE=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E4=B8=8B=E3=81=A7=E3=83=81=E3=83=A3=E3=83=B3=E3=83=8D?= =?UTF-8?q?=E3=83=AB=E3=82=84=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC=E3=81=AE?= =?UTF-8?q?=E3=83=8E=E3=83=BC=E3=83=88=E4=B8=80=E8=A6=A7=E3=81=AB=E6=9C=80?= =?UTF-8?q?=E6=96=B0=E3=81=AE=E3=83=8E=E3=83=BC=E3=83=88=E3=81=8C=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E3=81=95=E3=82=8C=E3=81=AA=E3=81=8F=E3=81=AA=E3=82=8B?= =?UTF-8?q?=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3=20(#12431)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 特定の条件下でチャンネルやユーザーのノート一覧に最新のノートが表示されなくなる問題を修正 * update: CHANGELOG.md --- CHANGELOG.md | 1 + .../backend/src/server/api/endpoints/channels/timeline.ts | 6 +++++- packages/backend/src/server/api/endpoints/users/notes.ts | 6 +++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5678da25a..64720ef48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ - Fix: ロールタイムラインが保存されない問題を修正 - Fix: api.jsonの生成ロジックを改善 #12402 - Fix: 招待コードが使い回せる問題を修正 +- Fix: 特定の条件下でチャンネルやユーザーのノート一覧に最新のノートが表示されなくなる問題を修正 ## 2023.11.1 diff --git a/packages/backend/src/server/api/endpoints/channels/timeline.ts b/packages/backend/src/server/api/endpoints/channels/timeline.ts index fae4249c8..4ca7325f3 100644 --- a/packages/backend/src/server/api/endpoints/channels/timeline.ts +++ b/packages/backend/src/server/api/endpoints/channels/timeline.ts @@ -15,6 +15,7 @@ import { IdService } from '@/core/IdService.js'; import { FunoutTimelineService } from '@/core/FunoutTimelineService.js'; import { isUserRelated } from '@/misc/is-user-related.js'; import { CacheService } from '@/core/CacheService.js'; +import { MetaService } from '@/core/MetaService.js'; import { ApiError } from '../../error.js'; export const meta = { @@ -72,12 +73,15 @@ export default class extends Endpoint { // eslint- private funoutTimelineService: FunoutTimelineService, private cacheService: CacheService, private activeUsersChart: ActiveUsersChart, + private metaService: MetaService, ) { super(meta, paramDef, async (ps, me) => { const untilId = ps.untilId ?? (ps.untilDate ? this.idService.gen(ps.untilDate!) : null); const sinceId = ps.sinceId ?? (ps.sinceDate ? this.idService.gen(ps.sinceDate!) : null); const isRangeSpecified = untilId != null && sinceId != null; + const serverSettings = await this.metaService.fetch(); + const channel = await this.channelsRepository.findOneBy({ id: ps.channelId, }); @@ -88,7 +92,7 @@ export default class extends Endpoint { // eslint- if (me) this.activeUsersChart.read(me); - if (isRangeSpecified || sinceId == null) { + if (serverSettings.enableFanoutTimeline && (isRangeSpecified || sinceId == null)) { const [ userIdsWhoMeMuting, ] = me ? await Promise.all([ diff --git a/packages/backend/src/server/api/endpoints/users/notes.ts b/packages/backend/src/server/api/endpoints/users/notes.ts index a43e57292..2e7d939b1 100644 --- a/packages/backend/src/server/api/endpoints/users/notes.ts +++ b/packages/backend/src/server/api/endpoints/users/notes.ts @@ -15,6 +15,7 @@ import { IdService } from '@/core/IdService.js'; import { isUserRelated } from '@/misc/is-user-related.js'; import { QueryService } from '@/core/QueryService.js'; import { FunoutTimelineService } from '@/core/FunoutTimelineService.js'; +import { MetaService } from '@/core/MetaService.js'; import { ApiError } from '../../error.js'; export const meta = { @@ -71,6 +72,7 @@ export default class extends Endpoint { // eslint- private cacheService: CacheService, private idService: IdService, private funoutTimelineService: FunoutTimelineService, + private metaService: MetaService, ) { super(meta, paramDef, async (ps, me) => { const untilId = ps.untilId ?? (ps.untilDate ? this.idService.gen(ps.untilDate!) : null); @@ -78,7 +80,9 @@ export default class extends Endpoint { // eslint- const isRangeSpecified = untilId != null && sinceId != null; const isSelf = me && (me.id === ps.userId); - if (isRangeSpecified || sinceId == null) { + const serverSettings = await this.metaService.fetch(); + + if (serverSettings.enableFanoutTimeline && (isRangeSpecified || sinceId == null)) { const [ userIdsWhoMeMuting, ] = me ? await Promise.all([