From 6638c5d43ac6141f2e8f78d5c2ba51f55751fafd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Tron=C3=AD=C4=8Dek?= Date: Tue, 27 Feb 2024 09:33:08 +0100 Subject: [PATCH] Fix failed prebuild reruns (#19472) * Fix failed prebuild reruns * Clean up effect deps * Dispose of hanging streams Co-authored-by: mustard --------- Co-authored-by: mustard --- .../src/prebuilds/detail/PrebuildDetailPage.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/components/dashboard/src/prebuilds/detail/PrebuildDetailPage.tsx b/components/dashboard/src/prebuilds/detail/PrebuildDetailPage.tsx index 39035b2c3e6c6c..209c3d783256d1 100644 --- a/components/dashboard/src/prebuilds/detail/PrebuildDetailPage.tsx +++ b/components/dashboard/src/prebuilds/detail/PrebuildDetailPage.tsx @@ -67,10 +67,15 @@ export const PrebuildDetailPage: FC = () => { const triggeredString = useMemo(() => formatDate(triggeredDate), [triggeredDate]); useEffect(() => { - watchPrebuild(prebuildId, (prebuild) => { + setLogNotFound(false); + const disposable = watchPrebuild(prebuildId, (prebuild) => { setCurrentPrebuild(prebuild); }); - }, [prebuildId, setCurrentPrebuild]); + + return () => { + disposable.dispose(); + }; + }, [prebuildId]); useEffect(() => { logEmitter.on("error", (err: Error) => {