From 52835f1eb0b37404bcd8b77915203adf076a4a4b Mon Sep 17 00:00:00 2001 From: zipg Date: Tue, 7 Jul 2026 13:50:29 +0800 Subject: [PATCH] fix: show timeout action for SQL execution timeouts * fix: show timeout action for SQL execution timeouts * fix: detect agent RPC timeout in query error action --------- Co-authored-by: zipg <4047349+zipg@users.noreply.github.com> Co-authored-by: t8y2 <1156263951@qq.com> --- .../src/components/layout/ContentArea.vue | 7 +--- .../src/lib/__tests__/sql/queryError.spec.ts | 38 +++++++++++++++++++ apps/desktop/src/lib/sql/queryError.ts | 16 ++++++++ 3 files changed, 56 insertions(+), 5 deletions(-) create mode 100644 apps/desktop/src/lib/__tests__/sql/queryError.spec.ts create mode 100644 apps/desktop/src/lib/sql/queryError.ts diff --git a/apps/desktop/src/components/layout/ContentArea.vue b/apps/desktop/src/components/layout/ContentArea.vue index 94de3623ae..658cb63c1f 100644 --- a/apps/desktop/src/components/layout/ContentArea.vue +++ b/apps/desktop/src/components/layout/ContentArea.vue @@ -54,6 +54,7 @@ import { useConnectionStore } from "@/stores/connectionStore"; import { TABLE_FONT_SIZE_MAX, TABLE_FONT_SIZE_MIN, useSettingsStore, type DataGridSearchMode } from "@/stores/settingsStore"; import { useToast } from "@/composables/useToast"; import { canCancelQueryExecution, queryExecutionLabelKey } from "@/lib/sql/queryExecutionState"; +import { isQueryTimeoutErrorMessage } from "@/lib/sql/queryError"; import { databaseDisplayNameForTab, executionSummaryItems, nextExecutionSummaryView, resultGridCacheKey, resultRunItems, resultSqlForGrid, tabularResultItems } from "@/lib/tabs/tabPresentation"; import { defaultQueryResultArchiveFileName } from "@/lib/query/queryResultArchive"; import { saveQueryResultArchiveFile } from "@/lib/query/queryResultArchiveFile"; @@ -185,10 +186,6 @@ const dataGridSearchMode = computed(() => settingsStore.editorSettings.dataGridS const tableFontSize = computed(() => settingsStore.editorSettings.tableFontSize); const redisKeyBrowserRef = ref(); -function isQueryTimeoutError(message: string): boolean { - const lower = message.toLowerCase(); - return lower.includes("query timed out") || lower.includes("查询超时"); -} const etcdKeyBrowserRef = ref(); const zookeeperKeyBrowserRef = ref(); const objectBrowserRef = ref(); @@ -1116,7 +1113,7 @@ defineExpose({ focusSearch, refreshData, handleModRTarget, requestQueryEditorExe @sort="(column: string, columnIndex: number, direction: 'asc' | 'desc' | null, whereInput?: string, mode?: DataGridSortMode) => emit('sort', column, columnIndex, direction, whereInput, mode)" >