完善消息去重并增加说明文档#576
Open
chenjei2011 wants to merge 1 commit into
Open
Conversation
🤖 Augment PR SummarySummary: This PR tightens NotificationCenterService message de-duplication to reduce repeated popups in high-frequency plugin scenarios. Changes:
🤖 Was this summary useful? React with 👍 or 👎 |
| if (_lastMessage.Title == message.Title && totalSeconds <= DeduplicationWindowSeconds && message.Source == _lastMessage.Source && message.Summary == _lastMessage.Summary) | ||
| { | ||
| _lastMessage.Time = message.CreatedAt; | ||
| Console.WriteLine("[info]标题" + message.Title + "已被自动去重" + "发送方" + message.Source); |
Contributor
Author
There was a problem hiding this comment.
对于插件或程序运行错误导致的大批量的通知,如果直接记录日志会导致日志体积快速膨胀,有计划在以后对于拦截采用日志记录(但要加重复的只记录一次的逻辑)
| ## 描述 | ||
| 为避免插件在短时间内高频推送相同通知(例如网络重连、循环异常等)干扰课堂体验,"NotificationCenterService" 内置了 滑动窗口去重 策略。符合去重条件的消息将被静默抑制,不会重复弹出。 | ||
| ## 触发条件 | ||
| ### 要同时满足以下条件才会被去重 |
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.
1 修改相关变量名等
2 使去重条件更加严格
3 增加说明文档
JudgeRepeatMessageStruct改为类LastMessageInfoSummary字段的比较,使得标题相同但内容不同的通知不会被误判为重复。Title非空的消息才会更新去重相关变量,避免无标题消息干扰消息去重说明.md