Skip to content

Skip notifications-batch call when user_msg_list is empty - #917

Merged
freeplant merged 1 commit into
masterfrom
fix-skip-empty-notifications-batch
Oct 16, 2026
Merged

freeplant merged 1 commit into
masterfrom
fix-skip-empty-notifications-batch

Conversation

@AlexCXC

@AlexCXC AlexCXC commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@seafile-dev seafile-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

结论:非阻塞意见,未发现本次改动引入的功能性缺陷。

阻塞问题:无。

警告:缺少随代码提交的通知空批次回归测试,见行内意见。建议补充空列表不发请求、非空列表正常发送以及错误响应继续抛出的测试。

验证:在该提交上执行了提取原始生产方法体的依赖隔离检查,并与 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:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[警告] 补充空批次回归测试

影响:此次修复依赖该提前返回,但 PR 未加入通知发送测试,现有 CI 仅运行 SQL 测试。若后续移除或绕过此判断,空批次再次触发 Go 接口 400 的问题不会被现有测试发现。

建议修复:提交 mock requests.post 的单元测试,断言 [] 不发请求且正常返回;同时覆盖非空批次恰好发送一次、请求体不变及错误响应仍抛出异常。

@freeplant
freeplant merged commit dca0caa into master Oct 16, 2026
1 check passed
@freeplant
freeplant deleted the fix-skip-empty-notifications-batch branch October 16, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants