From 4e7c1f4f4495c426b50868c2a20dd997f1f34ed9 Mon Sep 17 00:00:00 2001 From: wangxiaolei Date: Thu, 22 Jan 2026 11:13:14 +0800 Subject: [PATCH 1/2] fix: fix visibilityState event handle (#31354) --- web/app/components/workflow/index.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/web/app/components/workflow/index.tsx b/web/app/components/workflow/index.tsx index 1543bce714..62516a797d 100644 --- a/web/app/components/workflow/index.tsx +++ b/web/app/components/workflow/index.tsx @@ -95,6 +95,7 @@ import { import SyncingDataModal from './syncing-data-modal' import { ControlMode, + WorkflowRunningStatus, } from './types' import { setupScrollToNodeListener } from './utils/node-navigation' import { WorkflowHistoryProvider } from './workflow-history-store' @@ -231,11 +232,20 @@ export const Workflow: FC = memo(({ const { handleRefreshWorkflowDraft } = useWorkflowRefreshDraft() const handleSyncWorkflowDraftWhenPageClose = useCallback(() => { - if (document.visibilityState === 'hidden') + if (document.visibilityState === 'hidden') { syncWorkflowDraftWhenPageClose() + return + } + + if (document.visibilityState === 'visible') { + const { isListening, workflowRunningData } = workflowStore.getState() + const status = workflowRunningData?.result?.status + // Avoid resetting UI state when user comes back while a run is active or listening for triggers + if (isListening || status === WorkflowRunningStatus.Running) + return - else if (document.visibilityState === 'visible') setTimeout(() => handleRefreshWorkflowDraft(), 500) + } }, [syncWorkflowDraftWhenPageClose, handleRefreshWorkflowDraft, workflowStore]) // Also add beforeunload handler as additional safety net for tab close From e1b987b48b2cc46fe5dd405c9fb32d43a876ce30 Mon Sep 17 00:00:00 2001 From: FFXN Date: Thu, 22 Jan 2026 14:05:19 +0800 Subject: [PATCH 2/2] fix: fix summary index bug. --- api/tasks/document_indexing_task.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/tasks/document_indexing_task.py b/api/tasks/document_indexing_task.py index 9f3655789c..39b84d62b8 100644 --- a/api/tasks/document_indexing_task.py +++ b/api/tasks/document_indexing_task.py @@ -112,6 +112,8 @@ def _document_indexing(dataset_id: str, document_ids: Sequence[str]): if dataset.indexing_technique == "high_quality": summary_index_setting = dataset.summary_index_setting if summary_index_setting and summary_index_setting.get("enable"): + # expire all session to get latest document's indexing status + session.expire_all() # Check each document's indexing status and trigger summary generation if completed for document_id in document_ids: # Re-query document to get latest status (IndexingRunner may have updated it)