From db9f6f45ed56c4c77c706cd7b70726eebb36a300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hartmut=20N=C3=B6renberg?= Date: Sun, 15 Mar 2026 09:40:49 +0100 Subject: [PATCH] fix: auto-poll order detail while renders are active (3s interval) Added refetchInterval to the order query that polls every 3 seconds while render_progress has pending or processing lines. Stops polling automatically when all renders reach a terminal state (completed/failed/cancelled). Fixes: render log and backend status not appearing until manual page reload. Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/src/pages/OrderDetail.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/src/pages/OrderDetail.tsx b/frontend/src/pages/OrderDetail.tsx index 082135a..26ac59c 100644 --- a/frontend/src/pages/OrderDetail.tsx +++ b/frontend/src/pages/OrderDetail.tsx @@ -81,6 +81,12 @@ export default function OrderDetailPage() { const { data: order, isLoading } = useQuery({ queryKey: ['order', id], queryFn: () => getOrder(id!), + // Poll while renders are active (pending/processing) — stop when all terminal + refetchInterval: (query) => { + const rp = query.state.data?.render_progress + if (!rp) return false + return (rp.pending > 0 || rp.processing > 0) ? 3000 : false + }, }) const submitMut = useMutation({