From dae14a8a1013ee71d7858693eaadc9294e021d4a Mon Sep 17 00:00:00 2001 From: shenlei Date: Tue, 1 Sep 2026 11:34:57 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20App=5FStore=20=E9=92=89=E9=92=89?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=9B=A0=E7=BC=BA=E5=B0=91=E5=85=B3=E9=94=AE?= =?UTF-8?q?=E8=AF=8D=E3=80=8C=E6=89=93=E5=8C=85=E3=80=8D=E8=A2=AB=E6=8B=A6?= =?UTF-8?q?=E6=88=AA=EF=BC=8C=E6=A0=87=E9=A2=98=E6=94=B9=E5=9B=9E=E5=90=AB?= =?UTF-8?q?=E3=80=8C=E6=89=93=E5=8C=85=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 钉钉机器人启用了自定义关键词校验。9ace2c8 将 App_Store 标题改为 「【iOS】App_Store 包信息」,丢掉了「打包」二字,导致消息被钉钉拒收 (errmsg: 关键词不匹配),任务日志出现「钉钉通知未发送」。 标题改回「【iOS】App_Store 打包信息」,重新包含关键词;测试同步更新。 Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_014FETBaqMgRqx3kdpzccKg1 --- backend/services/notification.py | 3 ++- tests/test_notification.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/services/notification.py b/backend/services/notification.py index 5ebbee6..eef732b 100644 --- a/backend/services/notification.py +++ b/backend/services/notification.py @@ -52,7 +52,8 @@ def build_dingtalk_payload( """生成与 AutoPacking/upload_iap.py 一致的钉钉 Markdown 内容。""" mobiles = _normalize_mobiles(at_mobiles) # App_Store 包与 Ad Hoc 用不同标题,App_Store 只有 IPA 下载地址、无二维码。 - heading = "【iOS】App_Store 包信息" if config_data.get("BUILD_TYPE") == "App_Store" else "【iOS】打包信息" + # 标题必须保留「打包」二字:钉钉机器人启用了自定义关键词,缺少关键词会被拒收。 + heading = "【iOS】App_Store 打包信息" if config_data.get("BUILD_TYPE") == "App_Store" else "【iOS】打包信息" details = ( f"**环境:** {config_data.get('SERVER', '')}\n\n" f"**版本:** {config_data.get('VERSION', '')}\n\n" diff --git a/tests/test_notification.py b/tests/test_notification.py index c75cb25..367fe4b 100644 --- a/tests/test_notification.py +++ b/tests/test_notification.py @@ -80,8 +80,8 @@ def test_dingtalk_payload_app_store_heading_and_no_qr(): config, "https://oss.example.com/readoor/iOS/app_2_197_1.ipa" ) text = payload["markdown"]["text"] - assert "## 【iOS】App_Store 包信息" in text - assert "## 【iOS】打包信息" not in text + # 标题保留「打包」二字,避免命中钉钉自定义关键词拦截 + assert "## 【iOS】App_Store 打包信息" in text assert "**iOS 下载链接:** https://oss.example.com/readoor/iOS/app_2_197_1.ipa" in text assert "![image]" not in text @@ -104,7 +104,7 @@ def test_dingtalk_notification_app_store_uses_own_at_list(): sent = post.call_args.kwargs["json"] assert sent["at"]["atMobiles"] == ["13911111111", "13922222222"] - assert "## 【iOS】App_Store 包信息" in sent["markdown"]["text"] + assert "## 【iOS】App_Store 打包信息" in sent["markdown"]["text"] assert "@13800000000" not in sent["markdown"]["text"]