mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-25 17:57:06 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user