From 10e333bb158ae6821611531ba64084670cbbea4b Mon Sep 17 00:00:00 2001 From: kozakura913 <98575220+kozakura913@users.noreply.github.com> Date: Sat, 19 Oct 2024 00:34:12 +0900 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E7=9F=A5API=E3=81=8C=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E5=A2=83=E7=95=8C=E3=81=A7=E9=87=8D=E8=A4=87?= =?UTF-8?q?=E3=81=99=E3=82=8B=E5=95=8F=E9=A1=8C=E3=81=AE=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=20(#509)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG_YOJO.md | 3 ++- .../src/server/api/endpoints/i/notifications-grouped.ts | 2 +- packages/backend/src/server/api/endpoints/i/notifications.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG_YOJO.md b/CHANGELOG_YOJO.md index de5eb8736b..cbf9136d5e 100644 --- a/CHANGELOG_YOJO.md +++ b/CHANGELOG_YOJO.md @@ -45,7 +45,8 @@ Cherrypick 4.11.1 - Change: `notes/advanced-search`で`query`が必須ではなくなりました - Fix: (Opensearch利用時)高度な検索でリプライ除外にするとエラーがでる - Fix: ノート編集時に3001文字以上の場合編集できない問題を修正 - +- Fix: 通知APIがページ境界で重複する問題の修正 + ### Misc ## 1.0.1 diff --git a/packages/backend/src/server/api/endpoints/i/notifications-grouped.ts b/packages/backend/src/server/api/endpoints/i/notifications-grouped.ts index 833a74fe12..9bf5f0d0b2 100644 --- a/packages/backend/src/server/api/endpoints/i/notifications-grouped.ts +++ b/packages/backend/src/server/api/endpoints/i/notifications-grouped.ts @@ -97,7 +97,7 @@ export default class extends Endpoint { // eslint- return []; } - let notifications = notificationsRes.map(x => JSON.parse(x[1][1])).filter(x => x.id !== ps.untilId && x !== ps.sinceId) as MiNotification[]; + let notifications = notificationsRes.map(x => JSON.parse(x[1][1])).filter(x => x.id !== ps.untilId && x.id !== ps.sinceId) as MiNotification[]; if (includeTypes && includeTypes.length > 0) { notifications = notifications.filter(notification => includeTypes.includes(notification.type)); diff --git a/packages/backend/src/server/api/endpoints/i/notifications.ts b/packages/backend/src/server/api/endpoints/i/notifications.ts index 2f619380e9..7bfc0ee3a1 100644 --- a/packages/backend/src/server/api/endpoints/i/notifications.ts +++ b/packages/backend/src/server/api/endpoints/i/notifications.ts @@ -110,7 +110,7 @@ export default class extends Endpoint { // eslint- return []; } - notifications = notificationsRes.map(x => JSON.parse(x[1][1])) as MiNotification[]; + notifications = notificationsRes.map(x => JSON.parse(x[1][1])).filter(x => x.id !== ps.untilId && x.id !== ps.sinceId) as MiNotification[]; if (includeTypes && includeTypes.length > 0) { notifications = notifications.filter(notification => includeTypes.includes(notification.type));