fix: 新通知到来时清除上一轮acknowledgedCards

问题:用户点了红点卡片→ack=[3],之后新通知的diffStats
也返回changed=[3],被ack过滤→红点不显示。

修复:processMessage中,新通知到来时清除acknowledgedCards。
新通知=新一轮周期,上一轮的"已查看"不应影响新一轮。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
dongliang
2026-04-29 20:23:10 +09:30
parent aea8351990
commit 8ef170051a

View File

@@ -120,6 +120,12 @@ class NotificationManager @Inject constructor(
val taskIds = parseTaskIds(rawJson) val taskIds = parseTaskIds(rawJson)
if (taskIds.isEmpty()) return if (taskIds.isEmpty()) return
// 新通知到来 → 清除上一轮的已查看记录(新一轮通知周期开始)
if (acknowledgedCards.isNotEmpty()) {
Timber.d("通知: 新通知到来,清除上一轮 ack=${acknowledgedCards}")
acknowledgedCards.clear()
}
// 保存通知到达前的统计快照(只在首次通知时保存,后续累积不覆盖) // 保存通知到达前的统计快照(只在首次通知时保存,后续累积不覆盖)
if (preNotificationStats == null) { if (preNotificationStats == null) {
preNotificationStats = lastStats?.copy() preNotificationStats = lastStats?.copy()