Repository navigation
Skip notifications-batch call when user_msg_list is empty - #917
Merged
Merged
Conversation
seafile-dev
reviewed
Oct 16, 2026
seafile-dev
left a comment
There was a problem hiding this comment.
结论:非阻塞意见,未发现本次改动引入的功能性缺陷。
阻塞问题:无。
警告:缺少随代码提交的通知空批次回归测试,见行内意见。建议补充空列表不发请求、非空列表正常发送以及错误响应继续抛出的测试。
验证:在该提交上执行了提取原始生产方法体的依赖隔离检查,并与 base 对比;空列表和 None 不再触发 POST,非空批次的 URL、请求体、返回值及 400/404 错误传播保持原行为。修改文件的 Ruff 基础错误检查通过。审查探针未提交,不等同于仓库测试覆盖或真实 HTTP 集成验证。仓库 SQL 测试因环境缺少 sqlalchemy 未能启动;读取时 GitHub build 仍在运行。
范围:本次修复位于 Python API 客户端,避免空批次到达通知接口,不改变 JS/Go 服务端对空请求的 HTTP 状态约定。输入未提供设计文档,并明确无需设计文档。
| } | ||
|
|
||
| def batch_send_notification(self, user_msg_list): | ||
| if not user_msg_list: |
There was a problem hiding this comment.
[警告] 补充空批次回归测试
影响:此次修复依赖该提前返回,但 PR 未加入通知发送测试,现有 CI 仅运行 SQL 测试。若后续移除或绕过此判断,空批次再次触发 Go 接口 400 的问题不会被现有测试发现。
建议修复:提交 mock requests.post 的单元测试,断言 [] 不发请求且正常返回;同时覆盖非空批次恰好发送一次、请求体不变及错误响应仍抛出异常。
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.
No description provided.