From b9c5a4f2ef49df6e8a0cea00af1887f89d9845ac Mon Sep 17 00:00:00 2001 From: Ashit Rath Date: Tue, 23 Jul 2024 13:19:29 +0530 Subject: [PATCH] chore: add placeholder transformation function for packages error message (#35086) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Adds placeholder functions to transform trigger eval error in EE PR for https://github.com/appsmithorg/appsmith-ee/pull/4695 ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 784d698f1d7761af54b9b7e4061b77ef98cd3ce4 > Cypress dashboard. > Tags: `@tag.All` > Spec: >
Mon, 22 Jul 2024 13:11:23 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No ## Summary by CodeRabbit - **New Features** - Introduced a new function for processing evaluation errors, enhancing error management capabilities. - Improved error handling in the evaluation process for better debugging and clarity. - **Bug Fixes** - Enhanced type safety and clarity by incorporating new type definitions related to evaluation errors. --- app/client/src/ce/sagas/helpers.ts | 5 +++++ app/client/src/sagas/EvaluationsSaga.ts | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/client/src/ce/sagas/helpers.ts b/app/client/src/ce/sagas/helpers.ts index 96fe047b7d..ad8e1b0683 100644 --- a/app/client/src/ce/sagas/helpers.ts +++ b/app/client/src/ce/sagas/helpers.ts @@ -3,6 +3,7 @@ import { CreateNewActionKey } from "@appsmith/entities/Engine/actionHelpers"; import type { DeleteErrorLogPayload } from "actions/debuggerActions"; import type { Action } from "entities/Action"; import type { Log } from "entities/AppsmithConsole"; +import type { EvaluationError } from "utils/DynamicBindingUtils"; export interface ResolveParentEntityMetadataReturnType { parentEntityId?: string; @@ -30,3 +31,7 @@ export function* transformAddErrorLogsSaga(logs: Log[]) { export function* transformDeleteErrorLogsSaga(payload: DeleteErrorLogPayload) { return payload; } + +export function* transformTriggerEvalErrors(errors: EvaluationError[]) { + return errors; +} diff --git a/app/client/src/sagas/EvaluationsSaga.ts b/app/client/src/sagas/EvaluationsSaga.ts index 302ec13d8a..7bd113a852 100644 --- a/app/client/src/sagas/EvaluationsSaga.ts +++ b/app/client/src/sagas/EvaluationsSaga.ts @@ -113,6 +113,7 @@ import { getIsCurrentEditorWorkflowType } from "@appsmith/selectors/workflowSele import { evalErrorHandler } from "./EvalErrorHandler"; import AnalyticsUtil from "@appsmith/utils/AnalyticsUtil"; import { endSpan, startRootSpan } from "UITelemetry/generateTraces"; +import { transformTriggerEvalErrors } from "@appsmith/sagas/helpers"; const APPSMITH_CONFIGS = getAppsmithConfigs(); export const evalWorker = new GracefulWorkerService( @@ -351,10 +352,16 @@ export function* evaluateAndExecuteDynamicTrigger( }, ); const { errors = [] } = response as any; - yield call(dynamicTriggerErrorHandler, errors); + + const transformedErrors: EvaluationError[] = yield call( + transformTriggerEvalErrors, + errors, + ); + + yield call(dynamicTriggerErrorHandler, transformedErrors); yield fork(logDynamicTriggerExecution, { dynamicTrigger, - errors, + errors: transformedErrors, triggerMeta, }); return response;