From 712fa84a0237603d7488fb4247b7f4b3886711a0 Mon Sep 17 00:00:00 2001 From: orangecoding Date: Sat, 1 Nov 2025 10:30:08 +0100 Subject: [PATCH] smaller security and memory improvements --- ui/src/components/table/listings/ListingsTable.jsx | 9 ++++++++- ui/src/views/jobs/ProcessingTimes.jsx | 8 ++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ui/src/components/table/listings/ListingsTable.jsx b/ui/src/components/table/listings/ListingsTable.jsx index 97c27a3..4eecbee 100644 --- a/ui/src/components/table/listings/ListingsTable.jsx +++ b/ui/src/components/table/listings/ListingsTable.jsx @@ -209,6 +209,13 @@ export default function ListingsTable() { const handleFilterChange = useMemo(() => debounce((value) => setFreeTextFilter(value), 500), []); + useEffect(() => { + return () => { + // cleanup debounced handler to avoid memory leaks + handleFilterChange.cancel && handleFilterChange.cancel(); + }; + }, [handleFilterChange]); + const expandRowRender = (record) => { return (
@@ -235,7 +242,7 @@ export default function ListingsTable() { - + Link to Listing diff --git a/ui/src/views/jobs/ProcessingTimes.jsx b/ui/src/views/jobs/ProcessingTimes.jsx index 2846afd..044d0b8 100644 --- a/ui/src/views/jobs/ProcessingTimes.jsx +++ b/ui/src/views/jobs/ProcessingTimes.jsx @@ -79,8 +79,12 @@ export default function ProcessingTimes({ processingTimes = {} }) { icon={} aria-label="Start now" onClick={async () => { - await xhrPost('/api/jobs/startAll', null); - Toast.success('Successfully triggered Fredy search.'); + try { + await xhrPost('/api/jobs/startAll', null); + Toast.success('Successfully triggered Fredy search.'); + } catch { + Toast.error('Failed to trigger search'); + } }} > Search now