From fe117cdaecce22601ca599296f788d3212d264f7 Mon Sep 17 00:00:00 2001 From: spinline Date: Fri, 13 Feb 2026 12:11:14 +0300 Subject: [PATCH] chore: add detailed logging for web push notifications in webhook handler --- backend/src/handlers/notifications.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/src/handlers/notifications.rs b/backend/src/handlers/notifications.rs index e809ce7..08220b4 100644 --- a/backend/src/handlers/notifications.rs +++ b/backend/src/handlers/notifications.rs @@ -33,9 +33,13 @@ pub async fn torrent_finished_handler( let push_store = state.push_store.clone(); let title = "Torrent Tamamlandı".to_string(); let body = message; + let torrent_name = params.name.clone(); + tokio::spawn(async move { - if let Err(e) = crate::push::send_push_notification(&push_store, &title, &body).await { - tracing::error!("Failed to send push notification from webhook: {}", e); + tracing::info!("Attempting to send Web Push notification for torrent: {}", torrent_name); + match crate::push::send_push_notification(&push_store, &title, &body).await { + Ok(_) => tracing::info!("Web Push notification sent successfully for: {}", torrent_name), + Err(e) => tracing::error!("Failed to send Web Push notification for {}: {:?}", torrent_name, e), } }); }