fix: resolve webhook notification timestamp error and improve scroll timing

- 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 <noreply@anthropic.com>
This commit is contained in:
courtmanr@gmail.com
2025-06-02 16:53:49 +01:00
parent 96934b6c95
commit c817791aa8
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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: {
+2 -2
View File
@@ -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;
});