From 347e0487d9a28bdff1d9e7b15e32aaf7ca369683 Mon Sep 17 00:00:00 2001 From: wangdl Date: Fri, 19 Jun 2026 21:38:12 +0800 Subject: [PATCH] fix: remove non-existent POST /api/notifications/test from integration script Notification jobs are triggered implicitly by notifyJobComplete() during Active Recall analysis, not by a dedicated test endpoint. Script now checks Worker logs and DB records instead. Co-Authored-By: Claude Opus 4.7 --- test/m-ai-01-08-integration.sh | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/test/m-ai-01-08-integration.sh b/test/m-ai-01-08-integration.sh index bdfe253..eeee323 100644 --- a/test/m-ai-01-08-integration.sh +++ b/test/m-ai-01-08-integration.sh @@ -103,34 +103,26 @@ else fi # ─── 4. Notification 链路 ── +# Notification jobs are triggered implicitly by Active Recall/Feynman analysis +# via notifyJobComplete() → NotificationWorker. Verify after Active Recall section. echo "" echo "── 4. Notification 链路 ──" -echo -n " Triggering notification..." -NOTIF=$(curl -s -X POST "$API/api/notifications/test" \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer ${USER_TOKEN:-test}" \ - -d '{"type":"ai_job_succeeded","title":"Integration Test","content":"Verifying notification chain"}' 2>/dev/null) -NOTIF_STATUS=$(echo "$NOTIF" | python3 -c "import json,sys; d=json.load(sys.stdin); print(d.get('success', False))" 2>/dev/null || echo "") -if [ "$NOTIF_STATUS" = "True" ]; then - pass "Notification enqueued" -else - echo " (skipped — requires USER_TOKEN)" -fi - -echo " Worker processes notification queue:" -NOTIF_LOG=$(docker compose logs worker 2>/dev/null | grep -i "notification" | tail -3 || echo "") +echo " Notification jobs are created by Active Recall analysis (notifyJobComplete)." +echo " Worker log verification:" +NOTIF_LOG=$(docker compose logs worker 2>/dev/null | grep -i "notification" | tail -5 || echo "") if [ -n "$NOTIF_LOG" ]; then echo "$NOTIF_LOG" pass "NotificationWorker log entries found" else - echo " (no notification log entries yet — Worker may not have processed the job)" + echo " (no notification log entries yet — run Active Recall analysis to trigger notifyJobComplete)" fi -echo " Verify notification state in DB:" +echo "" +echo " Verify notification records in DB:" echo " docker compose exec mysql mysql -u zhixi_user -p\$MYSQL_PASSWORD zhixi -e \"" -echo " SELECT id, userId, type, title, readAt, createdAt FROM Notification WHERE type='ai_job_succeeded' ORDER BY createdAt DESC LIMIT 3;\" " +echo " SELECT id, userId, type, title, readAt, createdAt FROM Notification ORDER BY createdAt DESC LIMIT 5;\" " # ─── 5. Active Recall 全链路 ──