From a13f63f30c1a14c7183aaa8c4aa8973796db4d57 Mon Sep 17 00:00:00 2001 From: damocles Date: Wed, 20 May 2026 21:22:53 +0200 Subject: [PATCH] forge_notify: check mark-read HTTP status, warn on non-2xx --- hive-ag3nt/src/forge_notify.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hive-ag3nt/src/forge_notify.rs b/hive-ag3nt/src/forge_notify.rs index cb56e0a..bf94345 100644 --- a/hive-ag3nt/src/forge_notify.rs +++ b/hive-ag3nt/src/forge_notify.rs @@ -267,13 +267,21 @@ async fn poll_once(client: &reqwest::Client, forge_url: &str, token: &str, socke // Mark as read only after successful delivery so a failed-delivery // notification resurfaces on the next poll tick. let mark_url = format!("{forge_url}/api/v1/notifications/threads/{id}"); - if let Err(e) = client + match client .patch(&mark_url) .header("Authorization", format!("token {token}")) .send() .await { - debug!(%id, error = ?e, "forge_notify: mark-read failed (non-fatal)"); + Err(e) => { + warn!(%id, error = ?e, "forge_notify: mark-read request failed — notification will resurface"); + } + Ok(r) if !r.status().is_success() => { + warn!(%id, status = %r.status(), "forge_notify: mark-read returned non-2xx — notification will resurface"); + } + Ok(_) => { + debug!(%id, "forge_notify: marked read"); + } } } }