From 71dd5e2369911035ebaa38f7b55d525583aa81b8 Mon Sep 17 00:00:00 2001 From: Humberto Evans Date: Mon, 12 Feb 2024 17:54:36 -0800 Subject: [PATCH] do not assume missing heartbeat is a test --- server/notification-providers/heii-oncall.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/notification-providers/heii-oncall.js b/server/notification-providers/heii-oncall.js index 6332fee8..7e6bec20 100644 --- a/server/notification-providers/heii-oncall.js +++ b/server/notification-providers/heii-oncall.js @@ -16,18 +16,18 @@ class HeiiOnCall extends NotificationProvider { // Payload to Heii On-Call is the entire heartbat JSON const payload = heartbeatJSON ? heartbeatJSON : {}; - if (!heartbeatJSON) { - // Test button was clicked on Notification Setup, trigger the alert as a test - payload["message"] = "Testing UptimeKuma Trigger"; - return this.postNotification(notification, "alert", payload); - } - // If we can, add url back to mintor to payload const baseURL = await setting("primaryBaseURL"); if (baseURL && monitorJSON) { payload["url"] = baseURL + getMonitorRelativeURL(monitorJSON.id); } + if (!heartbeatJSON) { + // No heartbeatJSON. Could be test button, but not necessarily. Just pull msg into payload. + payload["msg"] = msg; + return this.postNotification(notification, "alert", payload); + } + if (heartbeatJSON.status === DOWN) { // Monitor is DOWN, alert on Heii On-Call return this.postNotification(notification, "alert", payload);