fix(backend): 表示されない通知が残り通知数として表示されるバグの修正#17530
Open
fruitriin wants to merge 4 commits into
Open
Conversation
UserEntityService.getNotificationsInfo() が Redis Stream の生エントリ数で未読 を返していたため、packMany で除外される通知 (解決済みフォローリクエスト・ 削除済みノート等) もカウントに含まれ、「通知ページに表示は無いのにバッジが 消えない」状態を引き起こしていた (misskey-dev#17427)。 unreadNotificationsCount と i/notifications のレスポンス件数が一致することを 3 シナリオで検証する: - 承認済みフォローリクエスト通知が packMany で除外されてもバッジに残らない - mention 通知の件数がバッジと一致する - メンション元ノートが削除されると mention 通知がバッジから除外される Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
UserEntityService.getNotificationsInfo() は Redis Stream の生エントリ数で 未読カウントを返していたため、packMany で表示時に除外される通知 (削除済み ノート・解決済みフォローリクエスト・サスペンドされた notifier・削除済み ロール等) もカウントに含まれていた。結果として「通知ページには何も表示 されないのにバッジに数字だけ残る」状態が発生し、その状態は唯一 "全件既読" ボタン (notifications/mark-all-as-read) でしか解消できなかった。 NotificationEntityService.packMany と同じバリデータを通した件数を未読数と して返すように変更する。これにより API レスポンスとバッジカウントが常に 一致し、解決済み通知や元データが消失した通知がカウントから自動的に除外 される。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…viders に追加 PR misskey-dev#17427 で UserEntityService.onModuleInit に moduleRef.get('NotificationEntityService') を追加したことで、 テストのローカル providers 配列に未登録だった NotificationEntityService が DI 解決できず unit テストが落ちていた。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #17530 +/- ##
===========================================
- Coverage 24.93% 24.89% -0.04%
===========================================
Files 1158 1160 +2
Lines 39539 39575 +36
Branches 11011 11019 +8
===========================================
- Hits 9858 9854 -4
- Misses 23780 23817 +37
- Partials 5901 5904 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
通知ページを開いても、通知がページングするまで残件が消えないみたいな奇妙な挙動(FEの挙動由来)は残るものの |
Contributor
|
このPRによるapi.jsonの差分 |
Contributor
Backend memory usage comparisonBefore GC
After GC
After Request
|
…存も providers に追加
NotificationEntityService.onModuleInit が
moduleRef.get('RoleEntityService') / moduleRef.get('ChatEntityService')
を呼ぶため、これらもテストモジュールに登録しないと
`Nest could not find RoleEntityService element` で落ちる。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
kakkokari-gtyih
approved these changes
Jun 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
通知の残件カウント通知にUI上表示されない通知の数が含まれてしまうのを修正
Why
Fix: #17427
Additional info (optional)
Checklist