diff --git a/app/client/src/ce/sagas/JSFunctionExecutionSaga.ts b/app/client/src/ce/sagas/JSFunctionExecutionSaga.ts deleted file mode 100644 index 393aa788a2..0000000000 --- a/app/client/src/ce/sagas/JSFunctionExecutionSaga.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { TriggerKind } from "constants/AppsmithActionConstants/ActionConstants"; -import type { TriggerSource } from "constants/AppsmithActionConstants/ActionConstants"; -import { call } from "redux-saga/effects"; -import type { TMessage } from "utils/MessageUtil"; -import { logJSActionExecution } from "@appsmith/sagas/analyticsSaga"; - -export function* logJSFunctionExecution( - data: TMessage<{ - data: { - jsFnFullName: string; - isSuccess: boolean; - triggerMeta: { - source: TriggerSource; - triggerPropertyName: string | undefined; - triggerKind: TriggerKind | undefined; - }; - }[]; - }>, -) { - const { - body: { data: executionData }, - } = data; - - // We only care about EVENT_EXECUTION - const triggerExecutionData = executionData.filter( - (execData) => - execData.triggerMeta.triggerKind === TriggerKind.EVENT_EXECUTION, - ); - yield call(logJSActionExecution, triggerExecutionData); -} diff --git a/app/client/src/ce/sagas/analyticsSaga.ts b/app/client/src/ce/sagas/analyticsSaga.ts index 769ef7d71c..e2bbbcb537 100644 --- a/app/client/src/ce/sagas/analyticsSaga.ts +++ b/app/client/src/ce/sagas/analyticsSaga.ts @@ -8,15 +8,10 @@ import { getCurrentPageId, } from "selectors/editorSelectors"; import type { TriggerMeta } from "@appsmith/sagas/ActionExecution/ActionExecutionSagas"; -import type { TriggerSource } from "constants/AppsmithActionConstants/ActionConstants"; import { TriggerKind } from "constants/AppsmithActionConstants/ActionConstants"; import { isArray } from "lodash"; import AnalyticsUtil from "utils/AnalyticsUtil"; -import { getEntityNameAndPropertyPath } from "@appsmith/workers/Evaluation/evaluationUtils"; -import { - getAppMode, - getJSActionFromName, -} from "@appsmith/selectors/entitiesSelector"; +import { getAppMode } from "@appsmith/selectors/entitiesSelector"; import type { AppState } from "@appsmith/reducers"; import { getWidget } from "sagas/selectors"; @@ -139,91 +134,3 @@ export function* logDynamicTriggerExecution({ }, ); } - -export function* logJSActionExecution( - executionData: { - jsFnFullName: string; - isSuccess: boolean; - triggerMeta: { - source: TriggerSource; - triggerPropertyName: string | undefined; - triggerKind: TriggerKind | undefined; - }; - }[], -) { - const { - appId, - appMode, - appName, - email, - instanceId, - isExampleApp, - pageId, - source, - userId, - }: UserAndAppDetails = yield call(getUserAndAppDetails); - for (const { isSuccess, jsFnFullName, triggerMeta } of executionData) { - const { entityName: JSObjectName, propertyPath: functionName } = - getEntityNameAndPropertyPath(jsFnFullName); - const jsAction: ReturnType = yield select( - (state: AppState) => - getJSActionFromName(state, JSObjectName, functionName), - ); - const triggeredWidget: ReturnType | undefined = - yield select((state: AppState) => - getWidget(state, triggerMeta.source?.id || ""), - ); - const dynamicPropertyPathList = triggeredWidget?.dynamicPropertyPathList; - const isJSToggled = !!dynamicPropertyPathList?.find( - (property) => property.key === triggerMeta.triggerPropertyName, - ); - AnalyticsUtil.logEvent("EXECUTE_ACTION", { - type: "JS", - name: functionName, - JSObjectName, - pageId, - appId, - appMode, - appName, - isExampleApp, - actionId: jsAction?.id, - userData: { - userId, - email, - appId, - source, - }, - widgetName: triggeredWidget?.widgetName, - widgetType: triggeredWidget?.type, - propertyName: triggerMeta.triggerPropertyName, - isJSToggled, - instanceId, - }); - - AnalyticsUtil.logEvent( - isSuccess ? "EXECUTE_ACTION_SUCCESS" : "EXECUTE_ACTION_FAILURE", - { - type: "JS", - name: functionName, - JSObjectName, - pageId, - appId, - appMode, - appName, - isExampleApp, - actionId: jsAction?.id, - userData: { - userId, - email, - appId, - source, - }, - widgetName: triggeredWidget?.widgetName, - widgetType: triggeredWidget?.type, - propertyName: triggerMeta.triggerPropertyName, - isJSToggled, - instanceId, - }, - ); - } -} diff --git a/app/client/src/ee/sagas/JSFunctionExecutionSaga.ts b/app/client/src/ee/sagas/JSFunctionExecutionSaga.ts deleted file mode 100644 index f31f67abb4..0000000000 --- a/app/client/src/ee/sagas/JSFunctionExecutionSaga.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "ce/sagas/JSFunctionExecutionSaga"; diff --git a/app/client/src/sagas/EvalWorkerActionSagas.ts b/app/client/src/sagas/EvalWorkerActionSagas.ts index 47214db221..9bb61e4645 100644 --- a/app/client/src/sagas/EvalWorkerActionSagas.ts +++ b/app/client/src/sagas/EvalWorkerActionSagas.ts @@ -17,7 +17,6 @@ import { executeTriggerRequestSaga, updateDataTreeHandler, } from "../sagas/EvaluationsSaga"; -import { logJSFunctionExecution } from "@appsmith/sagas/JSFunctionExecutionSaga"; import { handleStoreOperations } from "./ActionExecution/StoreActionSaga"; import type { EvalTreeResponseData, @@ -128,10 +127,6 @@ export function* handleEvalWorkerMessage(message: TMessage) { yield call(handleStoreOperations, data); break; } - case MAIN_THREAD_ACTION.LOG_JS_FUNCTION_EXECUTION: { - yield call(logJSFunctionExecution, message); - break; - } case MAIN_THREAD_ACTION.PROCESS_BATCHED_TRIGGERS: { const batchedTriggers = data; yield all(