Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

fix(dataset): skip clear-chunks confirmation when re-parsing on Go (#19851)

chanx577eecca3d88
diff --git a/web/src/pages/dataset/dataset/parsing-status-cell.test.tsx b/web/src/pages/dataset/dataset/parsing-status-cell.test.tsx
index 79a5146a77..a6fd46c54f 100644
--- a/web/src/pages/dataset/dataset/parsing-status-cell.test.tsx
+++ b/web/src/pages/dataset/dataset/parsing-status-cell.test.tsx
@@ -214,6 +214,20 @@ describe('ParsingStatusCell', () => {
container.querySelector('svg.lucide-circle-x'),
).not.toBeInTheDocument();
});
+
+ it('re-parses straight away without the drop-chunks confirmation', () => {
+ renderCell({
+ run: undefined,
+ ingestion_status: IngestionTaskStatus.COMPLETED,
+ chunk_count: 3,
+ parser_config: { enable_metadata: true },
+ });
+
+ fireEvent.click(screen.getByTestId('document-parse-toggle'));
+
+ expect(mockRunDocumentByIds).toHaveBeenCalledTimes(1);
+ expect(mockShowReparseDialog).not.toHaveBeenCalled();
+ });
});
it('runs a chunkless document once without opening the confirmation', () => {
diff --git a/web/src/pages/dataset/dataset/parsing-status-cell.tsx b/web/src/pages/dataset/dataset/parsing-status-cell.tsx
index 7ba4d90efe..eef586b84b 100644
--- a/web/src/pages/dataset/dataset/parsing-status-cell.tsx
+++ b/web/src/pages/dataset/dataset/parsing-status-cell.tsx
@@ -150,8 +150,10 @@ export function ParsingStatusCell({
// The confirmation only offers real choices when there are existing chunks to
// drop or auto-metadata to re-apply. Otherwise, and always when cancelling a
- // run, the action fires straight away.
+ // run, the action fires straight away. Go re-ingests in place server-side, so
+ // the dialog is Python-only.
const needsParseConfirm =
+ !isGo &&
!isRunning &&
(!isZeroChunk || Boolean(record?.parser_config?.enable_metadata));
diff --git a/web/src/pages/dataset/dataset/use-bulk-operate-dataset.tsx b/web/src/pages/dataset/dataset/use-bulk-operate-dataset.tsx
index ad65b9f378..9b7bf43542 100644
--- a/web/src/pages/dataset/dataset/use-bulk-operate-dataset.tsx
+++ b/web/src/pages/dataset/dataset/use-bulk-operate-dataset.tsx
@@ -10,6 +10,7 @@ import {
useSetDocumentStatus,
} from '@/hooks/use-document-request';
import { IDocumentInfo } from '@/interfaces/database/document';
+import { useIsGoBackend } from '@/utils/backend-variant';
import {
LucideCircleX,
LucideCylinder,
@@ -48,6 +49,7 @@ export function useBulkOperateDataset({
const { visible, showModal, hideModal } = useSetModalState();
const { findDocumentParseGaps } = useParserGapValidation();
const { knowledgeBase } = useKnowledgeBaseContext();
+ const isGo = useIsGoBackend();
const chunkNum = useMemo(() => {
if (!documents.length) {
@@ -153,8 +155,10 @@ export function useBulkOperateDataset({
// The confirmation only offers real choices when the selection has existing
// chunks to drop or auto-metadata to re-apply; otherwise run straight away.
+ // Go re-ingests in place server-side, so the dialog is Python-only.
const needsRunConfirm =
- chunkNum > 0 || Boolean(knowledgeBase?.parser_config?.enable_metadata);
+ !isGo &&
+ (chunkNum > 0 || Boolean(knowledgeBase?.parser_config?.enable_metadata));
const handleRunMenuClick = useCallback(() => {
if (needsRunConfirm) {