From c817791aa80c06dae72d65304d554c40419cd971 Mon Sep 17 00:00:00 2001 From: "courtmanr@gmail.com" Date: Mon, 2 Jun 2025 16:53:49 +0100 Subject: [PATCH] fix: resolve webhook notification timestamp error and improve scroll timing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix RangeError in AlertManager by using correct timestamp fields (triggeredAt/lastUpdate) instead of non-existent alert.timestamp - Replace Promise.resolve() with requestAnimationFrame() for better scroll position restoration timing 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- server/alertManager.js | 2 +- src/public/js/utils.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/alertManager.js b/server/alertManager.js index 05b4f58c9..c94091f59 100644 --- a/server/alertManager.js +++ b/server/alertManager.js @@ -1234,7 +1234,7 @@ This alert was generated by Pulse monitoring system. }; const payload = { - timestamp: new Date(alert.timestamp).toISOString(), + timestamp: new Date(alert.triggeredAt || alert.lastUpdate || Date.now()).toISOString(), alert: { id: alert.id, rule: { diff --git a/src/public/js/utils.js b/src/public/js/utils.js index 8c5d95bf0..4e2f684e6 100644 --- a/src/public/js/utils.js +++ b/src/public/js/utils.js @@ -299,8 +299,8 @@ PulseApp.utils = (() => { // Execute the update function updateFn(); - // Restore scroll positions after a microtask to ensure DOM is updated - Promise.resolve().then(() => { + // Restore scroll positions after DOM updates are complete + requestAnimationFrame(() => { element.scrollLeft = scrollLeft; element.scrollTop = scrollTop; });