fix: remove non-existent POST /api/notifications/test from integration script
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 44s
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 44s
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 <noreply@anthropic.com>
This commit is contained in:
parent
24ceb1353e
commit
347e0487d9
@ -103,34 +103,26 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# ─── 4. Notification 链路 ──
|
# ─── 4. Notification 链路 ──
|
||||||
|
# Notification jobs are triggered implicitly by Active Recall/Feynman analysis
|
||||||
|
# via notifyJobComplete() → NotificationWorker. Verify after Active Recall section.
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "── 4. Notification 链路 ──"
|
echo "── 4. Notification 链路 ──"
|
||||||
|
|
||||||
echo -n " Triggering notification..."
|
echo " Notification jobs are created by Active Recall analysis (notifyJobComplete)."
|
||||||
NOTIF=$(curl -s -X POST "$API/api/notifications/test" \
|
echo " Worker log verification:"
|
||||||
-H "Content-Type: application/json" \
|
NOTIF_LOG=$(docker compose logs worker 2>/dev/null | grep -i "notification" | tail -5 || echo "")
|
||||||
-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 "")
|
|
||||||
if [ -n "$NOTIF_LOG" ]; then
|
if [ -n "$NOTIF_LOG" ]; then
|
||||||
echo "$NOTIF_LOG"
|
echo "$NOTIF_LOG"
|
||||||
pass "NotificationWorker log entries found"
|
pass "NotificationWorker log entries found"
|
||||||
else
|
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
|
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 " 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 全链路 ──
|
# ─── 5. Active Recall 全链路 ──
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user