diff --git a/CHANGELOG.md b/CHANGELOG.md index a53d506ef5867ef81b48f02177412da4d739b305..5b2b4784afea95b9e741fe96adc4ddb0746507ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ - bullã‚’bull-mqã«ã‚¢ãƒƒãƒ—グレードã—ã€ã‚¸ãƒ§ãƒ–ã‚ューã®ãƒ‘フォーマンスを改善 - ストリーミングã®ãƒ‘フォーマンスを改善 - Fix: ãŠçŸ¥ã‚‰ã›ã®ç”»åƒURLを空ã«ã§ããªã„å•é¡Œã‚’ä¿®æ£ +- Fix: i/notificationsã®sinceIdãŒæ©Ÿèƒ½ã—ãªã„å•é¡Œã‚’ä¿®æ£ ## 13.12.2 diff --git a/packages/backend/src/server/api/endpoints/i/notifications.ts b/packages/backend/src/server/api/endpoints/i/notifications.ts index e141be764a795b483f00dd4f50a00a39f83c2b8d..f5662f4a0e819f876ca8620d9b84a45bbe32b3a2 100644 --- a/packages/backend/src/server/api/endpoints/i/notifications.ts +++ b/packages/backend/src/server/api/endpoints/i/notifications.ts @@ -91,18 +91,18 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { const includeTypes = ps.includeTypes && ps.includeTypes.filter(type => !(obsoleteNotificationTypes).includes(type as any)) as typeof notificationTypes[number][]; const excludeTypes = ps.excludeTypes && ps.excludeTypes.filter(type => !(obsoleteNotificationTypes).includes(type as any)) as typeof notificationTypes[number][]; - const limit = ps.limit + (ps.untilId ? 1 : 0); // untilIdã«æŒ‡å®šã—ãŸã‚‚ã®ã‚‚å«ã¾ã‚Œã‚‹ãŸã‚+1 + const limit = ps.limit + (ps.untilId ? 1 : 0) + (ps.sinceId ? 1 : 0); // untilIdã«æŒ‡å®šã—ãŸã‚‚ã®ã‚‚å«ã¾ã‚Œã‚‹ãŸã‚+1 const notificationsRes = await this.redisClient.xrevrange( `notificationTimeline:${me.id}`, ps.untilId ? this.idService.parse(ps.untilId).date.getTime() : '+', - '-', + ps.sinceId ? this.idService.parse(ps.sinceId).date.getTime() : '-', 'COUNT', limit); if (notificationsRes.length === 0) { return []; } - let notifications = notificationsRes.map(x => JSON.parse(x[1][1])).filter(x => x.id !== ps.untilId) as Notification[]; + let notifications = notificationsRes.map(x => JSON.parse(x[1][1])).filter(x => x.id !== ps.untilId && x !== ps.sinceId) as Notification[]; if (includeTypes && includeTypes.length > 0) { notifications = notifications.filter(notification => includeTypes.includes(notification.type));