mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-21 02:33:32 +00:00
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.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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)', {
|
||||
|
||||
Reference in New Issue
Block a user