@@ -97,6 +97,7 @@ const ProcessingStatusDialog = () => {
9797 data ?: ProcessingDialogProjectDetail ;
9898 } ;
9999 const projectId = ( projectDetail as any ) ?. id || projectRouteId ;
100+ const isProjectProcessing = projectDetail ?. image_processing_status === "PROCESSING" ;
100101 const {
101102 data : allTaskAssets ,
102103 refetch : refetchAllTaskAssets ,
@@ -125,22 +126,16 @@ const ProcessingStatusDialog = () => {
125126 enabled : ! ! projectId ,
126127 } ) ;
127128
128- // Enable queue-info (which triggers pull-based reconciliation against ScaleODM)
129- // whenever tasks are stuck in IMAGE_PROCESSING_STARTED, not only when the queue
130- // panel is explicitly open. Derived from raw query data so this is available
131- // before the taskList memo runs.
132- const hasProcessingTasks =
133- ( Array . isArray ( taskSummary ) &&
134- taskSummary . some ( ( t ) => t . task_state === "IMAGE_PROCESSING_STARTED" ) ) ||
135- ( Array . isArray ( allTaskAssets ) &&
136- ( allTaskAssets as any [ ] ) . some ( ( t ) => t . state === "IMAGE_PROCESSING_STARTED" ) ) ;
137-
138129 const {
139130 data : queueInfo ,
140131 refetch : refetchQueueInfo ,
141132 isFetching : isQueueFetching ,
142133 dataUpdatedAt : queueUpdatedAt ,
143- } = useGetOdmQueueInfo ( projectId , showQueueInfo || hasProcessingTasks ) as {
134+ } = useGetOdmQueueInfo ( projectId , showQueueInfo , {
135+ refetchOnWindowFocus : false ,
136+ refetchOnReconnect : false ,
137+ retry : false ,
138+ } ) as {
144139 data ?: OdmQueueInfo ;
145140 refetch : ( ) => Promise < any > ;
146141 isFetching : boolean ;
@@ -367,6 +362,28 @@ const ProcessingStatusDialog = () => {
367362 [ projectId , uploadGcpFile ] ,
368363 ) ;
369364
365+ const handleRefreshProcessingStatus = useCallback ( async ( ) => {
366+ if ( ! projectId ) return ;
367+
368+ // Queue-info is also the backend reconciliation check for both task-level
369+ // and project-level ScaleODM jobs. Keep it user-triggered via Refresh.
370+ await refetchQueueInfo ( ) . catch ( ( ) => undefined ) ;
371+
372+ await Promise . allSettled ( [
373+ refetchTaskSummary ( ) ,
374+ refetchCoverage ( ) ,
375+ refetchAllTaskAssets ( ) ,
376+ queryClient . invalidateQueries ( { queryKey : [ "project-detail" , projectId ] } ) ,
377+ ] ) ;
378+ } , [
379+ projectId ,
380+ queryClient ,
381+ refetchAllTaskAssets ,
382+ refetchCoverage ,
383+ refetchQueueInfo ,
384+ refetchTaskSummary ,
385+ ] ) ;
386+
370387 const totalTaskCount = useMemo ( ( ) => {
371388 if ( typeof projectDetail ?. total_task_count === "number" ) {
372389 return projectDetail . total_task_count ;
@@ -491,8 +508,7 @@ const ProcessingStatusDialog = () => {
491508
492509 const totalProcessable = tasksReady + tasksWithImagery ;
493510
494- const isFinalProcessingRunning =
495- projectDetail ?. image_processing_status === "PROCESSING" || isProcessingAll ;
511+ const isFinalProcessingRunning = isProjectProcessing || isProcessingAll ;
496512
497513 const finalProcessingDisabledReason = useMemo ( ( ) => {
498514 if ( isFinalProcessingRunning ) {
@@ -747,12 +763,7 @@ const ProcessingStatusDialog = () => {
747763 className = "naxatw-h-8 naxatw-shrink-0 naxatw-border-blue-300 naxatw-px-3 naxatw-text-xs naxatw-text-blue-700"
748764 leftIcon = "refresh"
749765 iconClassname = { `!naxatw-text-sm ${ isTaskSummaryFetching || isCoverageFetching || isQueueFetching || isAllTasksFetching ? "naxatw-animate-spin" : "" } ` }
750- onClick = { ( ) => {
751- refetchTaskSummary ( ) ;
752- refetchCoverage ( ) ;
753- refetchQueueInfo ( ) ;
754- refetchAllTaskAssets ( ) ;
755- } }
766+ onClick = { handleRefreshProcessingStatus }
756767 disabled = {
757768 isTaskSummaryFetching || isCoverageFetching || isQueueFetching || isAllTasksFetching
758769 }
@@ -1069,7 +1080,7 @@ const ProcessingStatusDialog = () => {
10691080 iconClassname = {
10701081 isQueueFetching ? "naxatw-animate-spin !naxatw-text-sm" : "!naxatw-text-sm"
10711082 }
1072- onClick = { ( ) => refetchQueueInfo ( ) }
1083+ onClick = { handleRefreshProcessingStatus }
10731084 disabled = { isQueueFetching }
10741085 >
10751086 Refresh
0 commit comments