From df1e96bf5ff2dcefedb8da1660f98d6341231d5d Mon Sep 17 00:00:00 2001 From: Marco Date: Mon, 18 Aug 2025 15:00:33 +0000 Subject: [PATCH 1/5] latest --- .../SearchState/useUpdateStateWithMetadata.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/components/webui/client/src/pages/SearchPage/SearchState/useUpdateStateWithMetadata.ts b/components/webui/client/src/pages/SearchPage/SearchState/useUpdateStateWithMetadata.ts index 284c03c8f7..b3964b918e 100644 --- a/components/webui/client/src/pages/SearchPage/SearchState/useUpdateStateWithMetadata.ts +++ b/components/webui/client/src/pages/SearchPage/SearchState/useUpdateStateWithMetadata.ts @@ -11,6 +11,11 @@ import {SEARCH_UI_STATE} from "./typings"; import {useResultsMetadata} from "./useResultsMetadata"; +/* +* Presto error name for user cancellation +*/ +const CANCEL_ERROR_NAME = "USER_CANCELED"; + /** * Custom hook to update the UI state to `DONE` when the results metadata signal indicates * that the query is complete, or `FAILED` if the query fails. If there is an error, it will @@ -30,6 +35,13 @@ const useUiUpdateOnDoneSignal = () => { updateSearchUiState(SEARCH_UI_STATE.DONE); break; case PRESTO_SEARCH_SIGNAL.FAILED: + // Presto reports user-initiated query cancellation as a failure, + // but we treat cancellation as a successful completion rather than an error. + if (resultsMetadata.errorMsg === CANCEL_ERROR_NAME) { + updateSearchUiState(SEARCH_UI_STATE.DONE); + + return; + } updateSearchUiState(SEARCH_UI_STATE.FAILED); notification.error({ description: resultsMetadata.errorMsg || "An error occurred during search", From 0933c57c189b4326af0068cf84a9ada5915d7aee Mon Sep 17 00:00:00 2001 From: Marco Date: Mon, 18 Aug 2025 17:21:01 +0000 Subject: [PATCH 2/5] latest --- .../SearchPage/SearchState/useUpdateStateWithMetadata.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/webui/client/src/pages/SearchPage/SearchState/useUpdateStateWithMetadata.ts b/components/webui/client/src/pages/SearchPage/SearchState/useUpdateStateWithMetadata.ts index b3964b918e..54c0ea3d21 100644 --- a/components/webui/client/src/pages/SearchPage/SearchState/useUpdateStateWithMetadata.ts +++ b/components/webui/client/src/pages/SearchPage/SearchState/useUpdateStateWithMetadata.ts @@ -35,8 +35,8 @@ const useUiUpdateOnDoneSignal = () => { updateSearchUiState(SEARCH_UI_STATE.DONE); break; case PRESTO_SEARCH_SIGNAL.FAILED: - // Presto reports user-initiated query cancellation as a failure, - // but we treat cancellation as a successful completion rather than an error. + // Presto reports query cancellation as a failure, but we treat cancellation as a + // successful completion rather than an error. if (resultsMetadata.errorMsg === CANCEL_ERROR_NAME) { updateSearchUiState(SEARCH_UI_STATE.DONE); From 0146f3f761f5ef246a9c1d3057416c2a33f91277 Mon Sep 17 00:00:00 2001 From: Marco Date: Mon, 18 Aug 2025 17:22:26 +0000 Subject: [PATCH 3/5] latest --- .../SearchPage/SearchState/useUpdateStateWithMetadata.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/webui/client/src/pages/SearchPage/SearchState/useUpdateStateWithMetadata.ts b/components/webui/client/src/pages/SearchPage/SearchState/useUpdateStateWithMetadata.ts index 54c0ea3d21..9ff612b830 100644 --- a/components/webui/client/src/pages/SearchPage/SearchState/useUpdateStateWithMetadata.ts +++ b/components/webui/client/src/pages/SearchPage/SearchState/useUpdateStateWithMetadata.ts @@ -35,8 +35,8 @@ const useUiUpdateOnDoneSignal = () => { updateSearchUiState(SEARCH_UI_STATE.DONE); break; case PRESTO_SEARCH_SIGNAL.FAILED: - // Presto reports query cancellation as a failure, but we treat cancellation as a - // successful completion rather than an error. + // Presto reports query cancellation as a failure, but we treat as a successful + // completion. if (resultsMetadata.errorMsg === CANCEL_ERROR_NAME) { updateSearchUiState(SEARCH_UI_STATE.DONE); From 0c331f962f8e6a97ef6079b3a43e9ce5c0d9ab69 Mon Sep 17 00:00:00 2001 From: davemarco <83603688+davemarco@users.noreply.github.com> Date: Mon, 18 Aug 2025 16:55:28 -0400 Subject: [PATCH 4/5] Update components/webui/client/src/pages/SearchPage/SearchState/useUpdateStateWithMetadata.ts Co-authored-by: hoophalab <200652805+hoophalab@users.noreply.github.com> --- .../pages/SearchPage/SearchState/useUpdateStateWithMetadata.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/webui/client/src/pages/SearchPage/SearchState/useUpdateStateWithMetadata.ts b/components/webui/client/src/pages/SearchPage/SearchState/useUpdateStateWithMetadata.ts index 9ff612b830..b9445b79c0 100644 --- a/components/webui/client/src/pages/SearchPage/SearchState/useUpdateStateWithMetadata.ts +++ b/components/webui/client/src/pages/SearchPage/SearchState/useUpdateStateWithMetadata.ts @@ -14,7 +14,7 @@ import {useResultsMetadata} from "./useResultsMetadata"; /* * Presto error name for user cancellation */ -const CANCEL_ERROR_NAME = "USER_CANCELED"; +const PRESTO_CANCEL_ERROR_NAME = "USER_CANCELED"; /** * Custom hook to update the UI state to `DONE` when the results metadata signal indicates From 00b1730bd10cef3b7daa62037a8ab82005677e84 Mon Sep 17 00:00:00 2001 From: davemarco <83603688+davemarco@users.noreply.github.com> Date: Mon, 18 Aug 2025 16:55:37 -0400 Subject: [PATCH 5/5] Update components/webui/client/src/pages/SearchPage/SearchState/useUpdateStateWithMetadata.ts Co-authored-by: hoophalab <200652805+hoophalab@users.noreply.github.com> --- .../SearchPage/SearchState/useUpdateStateWithMetadata.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/webui/client/src/pages/SearchPage/SearchState/useUpdateStateWithMetadata.ts b/components/webui/client/src/pages/SearchPage/SearchState/useUpdateStateWithMetadata.ts index b9445b79c0..d1d5652b83 100644 --- a/components/webui/client/src/pages/SearchPage/SearchState/useUpdateStateWithMetadata.ts +++ b/components/webui/client/src/pages/SearchPage/SearchState/useUpdateStateWithMetadata.ts @@ -37,10 +37,10 @@ const useUiUpdateOnDoneSignal = () => { case PRESTO_SEARCH_SIGNAL.FAILED: // Presto reports query cancellation as a failure, but we treat as a successful // completion. - if (resultsMetadata.errorMsg === CANCEL_ERROR_NAME) { + if (resultsMetadata.errorName === PRESTO_CANCEL_ERROR_NAME) { updateSearchUiState(SEARCH_UI_STATE.DONE); - return; + break; } updateSearchUiState(SEARCH_UI_STATE.FAILED); notification.error({