From b4943b1155f5b7f2fa16fac5b8095e132d91c2b5 Mon Sep 17 00:00:00 2001 From: Samuel James <143277412+SamuelSJames@users.noreply.github.com> Date: Sun, 21 Jun 2026 09:06:01 -0400 Subject: [PATCH] Listen for heartbeatList in Uptime Kuma adapter to catch monitors with no status-change history (#37) importantHeartbeatList only contains entries for status transitions, so a monitor that's been continuously up since creation never populates it, showing as "unknown" in ArchNest despite being healthy in Uptime Kuma. Co-authored-by: Claude --- backend/src/integrations/uptimeKuma.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/src/integrations/uptimeKuma.ts b/backend/src/integrations/uptimeKuma.ts index 2ef162e..7922d50 100644 --- a/backend/src/integrations/uptimeKuma.ts +++ b/backend/src/integrations/uptimeKuma.ts @@ -90,6 +90,14 @@ export const uptimeKuma: IntegrationAdapter = { const latest = beats[beats.length - 1] if (latest) lastHeartbeat.set(monitorId, latest) }) + // importantHeartbeatList only contains status-change events, so a monitor + // that's been continuously up since it was added has no entries there. + // heartbeatList carries the regular (non-"important") beat history and is + // sent for every monitor, so it's needed to populate those cases too. + s.on('heartbeatList', (monitorId: number, beats: Heartbeat[]) => { + const latest = beats[beats.length - 1] + if (latest) lastHeartbeat.set(monitorId, latest) + }) s.on('heartbeat', (beat: Heartbeat & { monitorID: number }) => { lastHeartbeat.set(beat.monitorID, beat) })