From 2137f85e1d70f92afa272f9beebc5763de0f6376 Mon Sep 17 00:00:00 2001 From: Evyatar Bluzer Date: Sat, 1 Aug 2026 03:54:23 +0700 Subject: [PATCH] fix(ui): correct Last checked timestamp in workspace close dialog (#2179) ## Problem In the ExecutionWorkspaceCloseDialog, the "Last checked" timestamp was using \`new Date()\` which show the current render time, not when the readiness check API call actually completed. \`\`\`tsx Last checked {formatDateTime(new Date())} // always NOW \`\`\` This mean every time React re-render the component (which happen frequently), the timestamp update to the current moment. User see "Last checked 2:45:30 PM" and think the check just ran, but actually it might have ran 30 seconds ago. The timestamp is lying. ## What I changed Changed from \`new Date()\` to \`new Date(readinessQuery.dataUpdatedAt)\` which is the actual timestamp from React Query tracking when the API response was last received. \`\`\`tsx Last checked {formatDateTime(new Date(readinessQuery.dataUpdatedAt))} // actual check time \`\`\` Now the timestamp accurately show when the close readiness check was performed. It stay stable between re-renders until the query actually refetch. ## How to test 1. Open an execution workspace > click Close button to open the dialog 2. The "Last checked" timestamp should show when the API call completed 3. Wait a few seconds - timestamp should NOT update (it's the query time, not render time) 4. Click "Recheck" or trigger refetch - timestamp should update to new fetch time 1 file, 1 line changed. --- ui/src/components/ExecutionWorkspaceCloseDialog.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/components/ExecutionWorkspaceCloseDialog.tsx b/ui/src/components/ExecutionWorkspaceCloseDialog.tsx index b103ffd8e8..21bde868a4 100644 --- a/ui/src/components/ExecutionWorkspaceCloseDialog.tsx +++ b/ui/src/components/ExecutionWorkspaceCloseDialog.tsx @@ -287,7 +287,7 @@ export function ExecutionWorkspaceCloseDialog({ ) : null}
- Last checked {formatDateTime(new Date())} + Last checked {formatDateTime(new Date(readinessQuery.dataUpdatedAt))}
) : null}