Skip to content

fix: Updating the function definition for checking reactive cyclic dependencies#41049

Merged
ankitakinger merged 4 commits intoreleasefrom
fix/reactive-cyclic-dependency
Jun 27, 2025
Merged

fix: Updating the function definition for checking reactive cyclic dependencies#41049
ankitakinger merged 4 commits intoreleasefrom
fix/reactive-cyclic-dependency

Conversation

@ankitakinger
Copy link
Contributor

@ankitakinger ankitakinger commented Jun 26, 2025

Description

Updating the function definition for checking reactive cyclic dependencies to throw an error in all such scenarios and block multiple execute API calls.

Fixes #41048

Automation

/ok-to-test tags="@tag.All"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/15919295485
Commit: 05c9f64
Cypress dashboard.
Tags: @tag.All
Spec:


Fri, 27 Jun 2025 07:06:10 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • Refactor

    • Improved the logic for detecting reactive dependency misuse, resulting in clearer and more efficient checks.
    • Updated type handling to support partial entities in action detection.
  • New Features

    • Enhanced detection of conflicting trigger and data paths within dependencies, providing immediate feedback when misuse is found.
    • Introduced a feature flag to control reactive dependency misuse detection.
  • Tests

    • Added comprehensive tests to validate detection of reactive dependency misuse in various direct and transitive dependency scenarios.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 26, 2025

Walkthrough

The detectReactiveDependencyMisuse function in DependencyMapUtils was refactored for clarity and efficiency. The logic for detecting misuse now leverages a new static method, getAllTransitiveDependencies, which collects all transitive dependencies for a node. The function then checks for conflicting trigger and data paths directly.

Changes

File(s) Change Summary
app/client/src/entities/DependencyMap/DependencyMapUtils.ts Refactored detectReactiveDependencyMisuse for simpler misuse detection; added static getAllTransitiveDependencies method; gated misuse detection behind feature flag.
app/client/src/entities/DependencyMap/tests/DependencyMapUtils.test.ts Added tests covering direct and transitive reactive dependency misuse detection scenarios.
app/client/src/ce/workers/Evaluation/evaluationUtils.ts Updated isJSAction function signature to accept partial entities instead of full entities.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant DependencyMapUtils
    participant DependencyMap

    Caller->>DependencyMapUtils: detectReactiveDependencyMisuse(dependencyMap)
    loop For each node in dependencyMap
        DependencyMapUtils->>DependencyMapUtils: getAllTransitiveDependencies(dependencyMap, node)
        DependencyMapUtils->>DependencyMap: Access dependency data
        DependencyMapUtils->>DependencyMapUtils: Check for trigger/data path misuse
        alt Misuse detected
            DependencyMapUtils-->>Caller: Throw error
        end
    end
    DependencyMapUtils-->>Caller: Complete without error
Loading

Assessment against linked issues

Objective Addressed Explanation
Detect and throw error for cyclic dependency causing API calls to loop (#41048)
Prevent infinite API execution loops due to dependency misuse (#41048)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes found.

Suggested labels

Critical, Production

Suggested reviewers

  • ApekshaBhosale
  • sneha122

Poem

Refactored logic, dependencies clear,
No more looping APIs to fear!
With static methods, cycles are caught,
Bugs like these are swiftly fought.
Code is tidy, errors in sight—
Appsmith devs, you did it right! 🚀


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 612aaf7 and 05c9f64.

📒 Files selected for processing (1)
  • app/client/src/entities/DependencyMap/DependencyMapUtils.ts (4 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: Aishwarya-U-R
PR: appsmithorg/appsmith#29405
File: app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2_Widget_API_Pagination_spec.js:37-41
Timestamp: 2024-07-26T21:12:57.228Z
Learning: The pull request titled "test: Cypress | Replace static with Dynamic waits - Part 1" is part of a phased approach where only certain test specifications are targeted for static wait removal in the initial phase. Future phases will address additional specs.
Learnt from: Aishwarya-U-R
PR: appsmithorg/appsmith#29405
File: app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2_Widget_API_Pagination_spec.js:37-41
Timestamp: 2024-10-08T15:32:39.374Z
Learning: The pull request titled "test: Cypress | Replace static with Dynamic waits - Part 1" is part of a phased approach where only certain test specifications are targeted for static wait removal in the initial phase. Future phases will address additional specs.
Learnt from: CR
PR: appsmithorg/appsmith#0
File: .cursor/rules/index.mdc:0-0
Timestamp: 2025-06-23T12:22:10.042Z
Learning: Pull request titles in the Appsmith codebase should follow the Conventional Commits specification, using the format 'type(scope): description' with valid types such as feat, fix, docs, style, refactor, perf, test, build, ci, chore, and revert.
Learnt from: CR
PR: appsmithorg/appsmith#0
File: .cursor/rules/index.md:0-0
Timestamp: 2025-06-23T12:22:06.140Z
Learning: Pull request titles in the Appsmith project must follow the Conventional Commits specification to ensure semantic and consistent commit history.
Learnt from: CR
PR: appsmithorg/appsmith#0
File: .cursor/rules/index.mdc:0-0
Timestamp: 2025-06-23T12:22:10.042Z
Learning: Cursor AI rules for Appsmith are automatically triggered by pull request and file change events, and can also be manually invoked through specific commands such as 'validate_pr_title', 'verify_bug_fix', 'generate_tests', 'optimize_performance', and 'validate_feature'.
Learnt from: sharat87
PR: appsmithorg/appsmith#30252
File: deploy/docker/fs/usr/lib/python3/dist-packages/supervisor/appsmith_supervisor_stdout.py:21-29
Timestamp: 2024-07-26T21:12:57.228Z
Learning: The user has confirmed that the suggested changes to handle potential exceptions and improve the robustness of the `main` function in `appsmith_supervisor_stdout.py` are acceptable.
Learnt from: brayn003
PR: appsmithorg/appsmith#37984
File: app/client/src/git/requests/pullRequest.ts:6-10
Timestamp: 2024-12-05T10:58:36.272Z
Learning: Error handling is not required for the `pullRequest` function in `app/client/src/git/requests/pullRequest.ts`.
Learnt from: sneha122
PR: appsmithorg/appsmith#30012
File: app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx:679-682
Timestamp: 2024-07-26T21:12:57.228Z
Learning: The user `sneha122` has confirmed the resolution of the feedback regarding the redundancy of `|| false` in the `_.get` expression within the `RestAPIDatasourceForm.tsx` file.
Learnt from: sneha122
PR: appsmithorg/appsmith#30012
File: app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx:679-682
Timestamp: 2024-10-08T15:32:34.115Z
Learning: The user `sneha122` has confirmed the resolution of the feedback regarding the redundancy of `|| false` in the `_.get` expression within the `RestAPIDatasourceForm.tsx` file.
Learnt from: sagar-qa007
PR: appsmithorg/appsmith#34955
File: app/client/cypress/e2e/Regression/ClientSide/ActionExecution/General_settings_Spec.ts:14-56
Timestamp: 2024-10-08T15:32:34.115Z
Learning: Learnt from: sagar-qa007
PR: appsmithorg/appsmith#34955
File: app/client/cypress/e2e/Regression/ClientSide/ActionExecution/General_settings_Spec.ts:14-56
Timestamp: 2024-07-16T06:44:55.118Z
Learning: Avoid using sleep functions like `agHelper.Sleep`, `this.Sleep`, and other related sleep functions in Cypress tests within the `app/client/cypress` directory to prevent non-deterministic behaviors and ensure tests are more reliable and maintainable.
Learnt from: brayn003
PR: appsmithorg/appsmith#38088
File: app/client/src/git/components/GitContextProvider/hooks/useGitBranches.ts:40-43
Timestamp: 2024-12-11T08:25:39.197Z
Learning: In `app/client/src/git/components/GitContextProvider/hooks/useGitBranches.ts`, the `useMemo` hook includes dependencies `artifactType` and `baseArtifactId` in its dependency array.
Learnt from: alex-golovanov
PR: appsmithorg/appsmith#39379
File: app/client/src/pages/AppIDE/components/LibrariesList/JSLibrariesSection.tsx:0-0
Timestamp: 2025-02-20T13:36:10.743Z
Learning: When reviewing React components, ensure that useMemo and useEffect hooks include all variables used within their callbacks in their dependency arrays to prevent stale values and potential bugs.
Learnt from: brayn003
PR: appsmithorg/appsmith#38088
File: app/client/src/git/components/GitQuickActions/BranchButton/index.tsx:72-74
Timestamp: 2024-12-11T08:33:24.352Z
Learning: In the 'BranchButton' component in 'app/client/src/git/components/GitQuickActions/BranchButton/index.tsx' (TypeScript, React), the `useEffect` hook that checks for label ellipsis does not need to include `currentBranch` in its dependency array.
app/client/src/entities/DependencyMap/DependencyMapUtils.ts (20)
Learnt from: abhvsn
PR: appsmithorg/appsmith#39171
File: app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/FeatureFlagServiceCEImpl.java:42-44
Timestamp: 2025-02-24T05:59:14.021Z
Learning: The reactive transition for helper methods consuming @FeatureFlagged annotations will be handled in a separate PR to maintain focused changes and proper separation of concerns.
Learnt from: brayn003
PR: appsmithorg/appsmith#38088
File: app/client/src/git/components/GitContextProvider/hooks/useGitBranches.ts:40-43
Timestamp: 2024-12-11T08:25:39.197Z
Learning: In `app/client/src/git/components/GitContextProvider/hooks/useGitBranches.ts`, the `useMemo` hook includes dependencies `artifactType` and `baseArtifactId` in its dependency array.
Learnt from: brayn003
PR: appsmithorg/appsmith#38088
File: app/client/src/git/components/GitQuickActions/BranchButton/index.tsx:72-74
Timestamp: 2024-12-11T08:33:24.352Z
Learning: In the 'BranchButton' component in 'app/client/src/git/components/GitQuickActions/BranchButton/index.tsx' (TypeScript, React), the `useEffect` hook that checks for label ellipsis does not need to include `currentBranch` in its dependency array.
Learnt from: ankitakinger
PR: appsmithorg/appsmith#29573
File: app/client/src/pages/Editor/Explorer/Entity/EntityProperties.tsx:46-65
Timestamp: 2024-07-26T21:12:57.228Z
Learning: The use of `any` for the `entityProperties` parameter in the `getJSActionBindings` function within `EntityProperties.tsx` is intentional and should not be suggested for refactoring to improve type safety.
Learnt from: alex-golovanov
PR: appsmithorg/appsmith#39379
File: app/client/src/pages/AppIDE/components/LibrariesList/JSLibrariesSection.tsx:0-0
Timestamp: 2025-02-20T13:36:10.743Z
Learning: When reviewing React components, ensure that useMemo and useEffect hooks include all variables used within their callbacks in their dependency arrays to prevent stale values and potential bugs.
Learnt from: ashit-rath
PR: appsmithorg/appsmith#35086
File: app/client/src/ce/sagas/helpers.ts:35-37
Timestamp: 2024-07-22T12:21:58.545Z
Learning: The `transformTriggerEvalErrors` function in `app/client/src/ce/sagas/helpers.ts` is typed as a generator function to maintain type safety because it gets overridden in another repository where `yield` statements are used.
Learnt from: ashit-rath
PR: appsmithorg/appsmith#35086
File: app/client/src/ce/sagas/helpers.ts:35-37
Timestamp: 2024-10-08T15:32:34.115Z
Learning: The `transformTriggerEvalErrors` function in `app/client/src/ce/sagas/helpers.ts` is typed as a generator function to maintain type safety because it gets overridden in another repository where `yield` statements are used.
Learnt from: AmanAgarwal041
PR: appsmithorg/appsmith#36539
File: app/client/src/workers/Evaluation/handlers/jsLibrary.ts:329-329
Timestamp: 2024-09-25T18:58:34.275Z
Learning: In `app/client/src/workers/Evaluation/handlers/jsLibrary.ts`, when removing keys from `self`, use `delete` to completely remove the property, as assigning `undefined` leaves the key in the object and can affect subsequent difference checks.
Learnt from: AmanAgarwal041
PR: appsmithorg/appsmith#36539
File: app/client/src/workers/Evaluation/handlers/jsLibrary.ts:329-329
Timestamp: 2024-10-08T15:32:39.374Z
Learning: In `app/client/src/workers/Evaluation/handlers/jsLibrary.ts`, when removing keys from `self`, use `delete` to completely remove the property, as assigning `undefined` leaves the key in the object and can affect subsequent difference checks.
Learnt from: sharat87
PR: appsmithorg/appsmith#34471
File: app/client/src/ce/api/JSActionAPI.tsx:143-161
Timestamp: 2024-06-26T06:22:15.976Z
Learning: The `updateJSCollectionActionRefactor` method in `JSActionAPI.tsx` includes a check to ensure `action.datasource` is not null before manipulating its properties.
Learnt from: sharat87
PR: appsmithorg/appsmith#37829
File: app/client/packages/rts/src/ctl/backup/links/EnvFileLink.ts:50-65
Timestamp: 2024-11-29T09:33:28.991Z
Learning: In `app/client/packages/rts/src/ctl/backup/links/EnvFileLink.ts`, changes to the `removeSensitiveEnvData` function should be approached cautiously, as it is sensitive and potentially flaky.
Learnt from: vhemery
PR: appsmithorg/appsmith#37371
File: app/client/cypress/e2e/Regression/ClientSide/Widgets/Image/Image_spec.js:44-47
Timestamp: 2024-11-13T09:07:54.931Z
Learning: When reviewing code in `app/client/cypress/**` paths, ensure that suggestions are appropriate for test code and not for `src` code. Avoid applying source code checks to test code unless relevant.
Learnt from: ashit-rath
PR: appsmithorg/appsmith#33809
File: app/client/src/workers/Evaluation/evaluate.ts:31-31
Timestamp: 2024-07-26T21:12:57.228Z
Learning: User prefers to handle extensive changes like improving type safety by replacing `any` with more specific types in a separate PR to manage the scope effectively.
Learnt from: sagar-qa007
PR: appsmithorg/appsmith#34955
File: app/client/cypress/e2e/Regression/ClientSide/ActionExecution/General_settings_Spec.ts:14-56
Timestamp: 2024-10-08T15:32:34.115Z
Learning: Learnt from: sagar-qa007
PR: appsmithorg/appsmith#34955
File: app/client/cypress/e2e/Regression/ClientSide/ActionExecution/General_settings_Spec.ts:14-56
Timestamp: 2024-07-16T06:44:55.118Z
Learning: Avoid using sleep functions like `agHelper.Sleep`, `this.Sleep`, and other related sleep functions in Cypress tests within the `app/client/cypress` directory to prevent non-deterministic behaviors and ensure tests are more reliable and maintainable.
Learnt from: Aishwarya-U-R
PR: appsmithorg/appsmith#29405
File: app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2_Widget_API_Pagination_spec.js:37-41
Timestamp: 2024-07-26T21:12:57.228Z
Learning: The pull request titled "test: Cypress | Replace static with Dynamic waits - Part 1" is part of a phased approach where only certain test specifications are targeted for static wait removal in the initial phase. Future phases will address additional specs.
Learnt from: Aishwarya-U-R
PR: appsmithorg/appsmith#29405
File: app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2_Widget_API_Pagination_spec.js:37-41
Timestamp: 2024-10-08T15:32:39.374Z
Learning: The pull request titled "test: Cypress | Replace static with Dynamic waits - Part 1" is part of a phased approach where only certain test specifications are targeted for static wait removal in the initial phase. Future phases will address additional specs.
Learnt from: sharat87
PR: appsmithorg/appsmith#34471
File: app/client/src/ce/api/JSActionAPI.tsx:143-161
Timestamp: 2024-10-08T15:32:39.374Z
Learning: The `updateJSCollectionActionRefactor` method in `JSActionAPI.tsx` includes a check to ensure `action.datasource` is not null before manipulating its properties.
Learnt from: sharat87
PR: appsmithorg/appsmith#34471
File: app/client/src/ce/api/JSActionAPI.tsx:98-111
Timestamp: 2024-10-08T15:32:34.115Z
Learning: The `updateJSCollection` method in `JSActionAPI.tsx` uses optional chaining and logical AND to safely handle potential null or undefined values for `action.datasource`.
Learnt from: ankitakinger
PR: appsmithorg/appsmith#29573
File: app/client/src/pages/Editor/Explorer/Entity/EntityProperties.tsx:240-0
Timestamp: 2024-10-08T15:32:34.114Z
Learning: The `ENTITY_TYPE.MODULE_INSTANCE` case in `EntityProperties.tsx` is intentionally a combination of the logic from both `ENTITY_TYPE.ACTION` and `ENTITY_TYPE.JSACTION`, which explains the presence of what might seem like duplicated code.
Learnt from: ankitakinger
PR: appsmithorg/appsmith#29573
File: app/client/src/pages/Editor/Explorer/Entity/EntityProperties.tsx:240-0
Timestamp: 2024-07-26T21:12:57.228Z
Learning: The `ENTITY_TYPE.MODULE_INSTANCE` case in `EntityProperties.tsx` is intentionally a combination of the logic from both `ENTITY_TYPE.ACTION` and `ENTITY_TYPE.JSACTION`, which explains the presence of what might seem like duplicated code.
🪛 Biome (1.9.4)
app/client/src/entities/DependencyMap/DependencyMapUtils.ts

[error] 202-202: Using this in a static context can be confusing.

this refers to the class.
Unsafe fix: Use the class name instead.

(lint/complexity/noThisInStatic)


[error] 212-212: Using this in a static context can be confusing.

this refers to the class.
Unsafe fix: Use the class name instead.

(lint/complexity/noThisInStatic)

⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: client-build / client-build
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-prettier / prettier-check
🔇 Additional comments (4)
app/client/src/entities/DependencyMap/DependencyMapUtils.ts (4)

30-32: LGTM: Feature flag implementation is well-structured.

Good practice to gate the new reactive dependency detection behind a feature flag for controlled rollout.

Also applies to: 48-48


173-194: LGTM: Entity filtering logic is correct.

The filtering logic properly identifies JSAction entities with at least one automatic function and Action entities with AUTOMATIC run behavior. This ensures the reactive dependency check only applies to relevant entities.


222-230: LGTM: Error handling with proper context.

The error is thrown immediately upon detection with comprehensive context including the node, trigger path, and data path. The error structure maintains compatibility with existing error handling logic.


235-259: LGTM: Efficient transitive dependency traversal.

The getAllTransitiveDependencies method correctly implements depth-first traversal with proper cycle prevention using a visited set. The implementation is clean and efficient.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added Bug Something isn't working Core Query Execution Issues related to the execution of all queries IDE Pod Issues that new developers face while exploring the IDE IDE Product Issues related to the IDE Product Integrations Pod Integrations Product Issues related to a specific integration Medium Issues that frustrate users due to poor UX Needs Triaging Needs attention from maintainers to triage Query Widgets & IDE Pod All issues related to Query, JS, Eval, Widgets & IDE Release labels Jun 26, 2025
@ankitakinger ankitakinger requested a review from sneha122 June 26, 2025 10:10
@ankitakinger ankitakinger added the ok-to-test Required label for CI label Jun 26, 2025
@ankitakinger
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@github-actions
Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/15899081506.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 41049.
recreate: .

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7bcd86d and 0ddddb7.

📒 Files selected for processing (1)
  • app/client/src/entities/DependencyMap/DependencyMapUtils.ts (1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
app/client/src/entities/DependencyMap/DependencyMapUtils.ts

[error] 173-173: Using this in a static context can be confusing.

this refers to the class.
Unsafe fix: Use the class name instead.

(lint/complexity/noThisInStatic)


[error] 183-183: Using this in a static context can be confusing.

this refers to the class.
Unsafe fix: Use the class name instead.

(lint/complexity/noThisInStatic)

⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-prettier / prettier-check
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-build / client-build
🔇 Additional comments (1)
app/client/src/entities/DependencyMap/DependencyMapUtils.ts (1)

209-230: Well-implemented DFS traversal with proper cycle handling.

The implementation correctly handles transitive dependency collection with cycle prevention. The use of a visited set and nested traversal function is appropriate.

Minor suggestion for consistency:

  /**
   * Returns all transitive dependencies (direct and indirect, no duplicates) for a given node.
+  * @param dependencyMap The dependency map to traverse
+  * @param node The starting node
+  * @returns Array of all transitive dependencies
   */

@github-actions
Copy link

Deploy-Preview-URL: https://ce-41049.dp.appsmith.com

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
app/client/src/entities/DependencyMap/__tests__/DependencyMapUtils.test.ts (1)

86-86: Fix typo in comment.

There's a duplicated "and" in the comment.

-    // JSObject1.myFun1 depends on both JSObject1.myFun2 and and Query2.data (transitive)
+    // JSObject1.myFun1 depends on both JSObject1.myFun2 and Query2.data (transitive)
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0ddddb7 and 672b406.

📒 Files selected for processing (1)
  • app/client/src/entities/DependencyMap/__tests__/DependencyMapUtils.test.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: client-prettier / prettier-check
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-build / client-build
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-lint / client-lint
🔇 Additional comments (5)
app/client/src/entities/DependencyMap/__tests__/DependencyMapUtils.test.ts (5)

1-5: Imports look clean and appropriate.

All necessary dependencies are imported correctly for the test scenarios.


7-24: Well-structured helper function for test setup.

The makeConfigTreeWithAction function creates a realistic mock ConfigTree with all required properties for an ACTION entity. Good separation of test setup logic.


26-50: Comprehensive test for direct dependency conflict.

This test correctly validates that the function throws when a node directly depends on both .run and .data of the same ACTION entity. The setup and assertions are clear.


52-72: Good coverage of non-conflicting scenarios.

Testing both .run-only and .data-only dependencies ensures no false positives. Using separate DependencyMap instances for each scenario is the right approach.


74-101: Excellent test for transitive dependency detection.

This test validates the core enhancement mentioned in the PR - detecting reactive dependency misuse through transitive relationships. The setup correctly creates a scenario where a node transitively depends on both .run and .data of the same ACTION entity.

@ankitakinger ankitakinger self-assigned this Jun 26, 2025
@ankitakinger
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@github-actions
Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/15909895928.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 41049.
recreate: .

@github-actions
Copy link

Deploy-Preview-URL: https://ce-41049.dp.appsmith.com

@ankitakinger
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@github-actions
Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/15919298508.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 41049.
recreate: .

@github-actions
Copy link

Deploy-Preview-URL: https://ce-41049.dp.appsmith.com

@ankitakinger ankitakinger merged commit 7914762 into release Jun 27, 2025
85 checks passed
@ankitakinger ankitakinger deleted the fix/reactive-cyclic-dependency branch June 27, 2025 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Core Query Execution Issues related to the execution of all queries IDE Pod Issues that new developers face while exploring the IDE IDE Product Issues related to the IDE Product Integrations Pod Integrations Product Issues related to a specific integration Medium Issues that frustrate users due to poor UX Needs Triaging Needs attention from maintainers to triage ok-to-test Required label for CI Query Widgets & IDE Pod All issues related to Query, JS, Eval, Widgets & IDE Release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Execute API calls are being triggered in loop non-stop

2 participants