From d0b88994aaa2792fb81af64aca1a5a7c77280bce Mon Sep 17 00:00:00 2001 From: Ashit Rath Date: Fri, 1 Aug 2025 17:05:44 +0530 Subject: [PATCH] fix: Skip JSObject eval where the path is the function (#41157) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description JSObjects and JSModuleInstance function paths were earlier skipped eval when present in the eval order. In the [reactive actions](https://github.com/appsmithorg/appsmith/pull/40963) PR this check was removed and due to that JSModuleInstances function were overriden in `evalContextCache` with it's uneval value. Due to which during any eval where the JSModuleInstance function is present as a binding, fails to evaluate This PR reverts the check Fixes https://github.com/appsmithorg/appsmith/issues/41146 ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 9a10adbc79bf5c2f2258b6dc4e013e4d66ac441d > Cypress dashboard. > Tags: `@tag.All` > Spec: >
Fri, 01 Aug 2025 05:00:23 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No ## Summary by CodeRabbit * **Bug Fixes** * Improved evaluation process to prevent unintended evaluation of action properties within JSObjects, resulting in more stable and predictable behavior for users. --- app/client/src/workers/common/DataTreeEvaluator/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/client/src/workers/common/DataTreeEvaluator/index.ts b/app/client/src/workers/common/DataTreeEvaluator/index.ts index 54dbb01f1f..2955bcea47 100644 --- a/app/client/src/workers/common/DataTreeEvaluator/index.ts +++ b/app/client/src/workers/common/DataTreeEvaluator/index.ts @@ -39,6 +39,7 @@ import { getAllPathsBasedOnDiffPaths, isDataPath, isJSModuleInstance, + isPropertyAnEntityAction, } from "ee/workers/Evaluation/evaluationUtils"; import { @@ -1192,7 +1193,11 @@ export default class DataTreeEvaluator { valuechanged[fullPropertyPath] = true; continue; } + // Skip evaluations for actions in JSObjects + if (isPropertyAnEntityAction(entity, propertyPath, entityConfig)) { + continue; + } // TODO: Fix this the next time the file is edited // eslint-disable-next-line @typescript-eslint/no-explicit-any