From 41fc15edeedb9aed033b1d5bb2ba86232cb80bb8 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Fri, 26 Jun 2026 14:49:12 +0100 Subject: [PATCH] Reduce console noise: downgrade repetitive alert WebSocket log to debug The backend broadcasts individual 'alert' WebSocket messages on every poll cycle for recurring alerts. These are intentionally not processed by the frontend (handled via state sync), but were logged at warn level, producing 12+ console warnings per page load. Downgraded to debug. Also wrapped global WebSocket store creation in createRoot to suppress SolidJS 'computations created outside createRoot' disposal warning. --- frontend-modern/src/stores/websocket-global.ts | 6 ++++-- frontend-modern/src/stores/websocket.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend-modern/src/stores/websocket-global.ts b/frontend-modern/src/stores/websocket-global.ts index 2d5edd16b..d0ebc4ee0 100644 --- a/frontend-modern/src/stores/websocket-global.ts +++ b/frontend-modern/src/stores/websocket-global.ts @@ -1,5 +1,5 @@ import { createWebSocketStore } from './websocket'; -import { createSignal } from 'solid-js'; +import { createSignal, createRoot } from 'solid-js'; import { createStore } from 'solid-js/store'; import { getPulseWebSocketUrl } from '@/utils/url'; import type { Alert, ResolvedAlert, State } from '@/types/api'; @@ -91,7 +91,9 @@ export function getGlobalWebSocketStore() { const wsUrl = getPulseWebSocketUrl(); - window.__pulseWsStore = createWebSocketStore(wsUrl); + createRoot(() => { + window.__pulseWsStore = createWebSocketStore(wsUrl); + }); bindGlobalShutdownHandler(); } diff --git a/frontend-modern/src/stores/websocket.ts b/frontend-modern/src/stores/websocket.ts index d9883602a..c754ba622 100644 --- a/frontend-modern/src/stores/websocket.ts +++ b/frontend-modern/src/stores/websocket.ts @@ -572,7 +572,7 @@ export function createWebSocketStore(url: string) { logger.info('WebSocket connection established'); } else if (message.type === 'alert') { // Individual alerts now handled via state sync - logger.warn('New alert received (will sync with next state update)', message.data); + logger.debug('New alert received (will sync with next state update)', message.data); } else if (message.type === 'alertResolved') { // Individual alert resolution now handled via state sync logger.info('Alert resolved (will sync with next state update)', {