fix: memory leak in SSE log accumulation and infinite reload loop in NodeContext

- Cap GlobalObservabilityView SSE log array at 10,000 entries to prevent
  unbounded memory growth during long dev-mode sessions
- Break NodeContext infinite re-fetch loop by replacing the activeNode
  closure dependency in refreshNodes with a useRef read, making the
  callback stable and preventing the useEffect -> setState -> useCallback
  -> useEffect cycle
This commit is contained in:
SaelixCode
2026-03-19 13:28:21 -04:00
parent 880919fb78
commit fd07374956
3 changed files with 11 additions and 6 deletions
@@ -93,9 +93,8 @@ export function GlobalObservabilityView() {
const batch = bufferRef.current.splice(0);
setLogs(prev => {
const merged = [...prev, ...batch];
// Infinite scroll: no slice limit in dev mode
merged.sort((a, b) => a.timestampMs - b.timestampMs);
return merged;
return merged.slice(-10000);
});
}
}, 500);