Skip to content

fix: Add inverse dependencies to default response in evaluateAndGenerateResponse#36780

Merged
rahulbarwal merged 3 commits intoreleasefrom
fix-36538/table-loader-not-working
Oct 10, 2024
Merged

fix: Add inverse dependencies to default response in evaluateAndGenerateResponse#36780
rahulbarwal merged 3 commits intoreleasefrom
fix-36538/table-loader-not-working

Conversation

@rahulbarwal
Copy link
Contributor

@rahulbarwal rahulbarwal commented Oct 9, 2024

Description

Problem
Table loader was not coming up when relaod was linked to any event other than page reload.

Root cause
Upon debugging we found that in one of the paths that generates inverseDependecyMap the object was always empty(for milliseconds only).

It led to table not knowing that the query/api linked is in loading state.
More details here on slack thread

Solution
This pull request adds the inverse dependencies to the default response in the evaluateAndGenerateResponse function. It ensures that the dependencies property in the defaultResponse object includes the inverse dependencies from the dataTreeEvaluator. This change improves the accuracy and completeness of the default response.

Fixes #36538
or
Fixes Issue URL

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

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/11269940675
Commit: 675e0f2
Cypress dashboard.
Tags: @tag.All
Spec:


Thu, 10 Oct 2024 10:32:29 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Enhanced evaluation and response generation for widget updates in data trees.
    • Improved dependency mapping in evaluation responses.
  • Bug Fixes

    • Added tests to ensure correct handling of widget updates and dependencies.
  • Refactor

    • Improved clarity and organization of test cases for better maintainability.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 9, 2024

Walkthrough

The pull request introduces enhancements to the test suite for the evalTreeWithChanges module, focusing on the evaluation and response generation processes for widgets in a data tree structure. Key modifications include the addition of new test cases, updates to existing tests, and structural refinements for clarity. The evaluateAndGenerateResponse function has also been updated to improve the response structure by incorporating dependencies, enhancing the overall evaluation process without altering any public entity declarations.

Changes

File Path Change Summary
app/client/src/workers/Evaluation/evalTreeWithChanges.test.ts Enhanced test suite with new test cases for evaluateAndGenerateResponse, modifications to existing tests, and refactoring for clarity.
app/client/src/workers/Evaluation/evalTreeWithChanges.ts Updated evaluateAndGenerateResponse to include defaultResponse.dependencies set to dataTreeEvaluator.inverseDependencies.

Assessment against linked issues

Objective Addressed Explanation
Loader functionality in tables (#36538) The changes do not address the loader issue in tables.

Suggested labels

Task, ok-to-test, Test, Widgets & Accelerators Pod

Suggested reviewers

  • ApekshaBhosale
  • sagar-qa007

🎉 In the realm of code, where logic does flow,
New tests are added, and clarity will grow.
Dependencies mapped, with responses so bright,
Evaluations refined, all working just right!
So let’s cheer for the changes, both big and small,
In the world of widgets, we’re improving it all! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 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 Low An issue that is neither critical nor breaks a user flow Table Widget V2 Issues related to Table Widget V2 Widgets & Accelerators Pod Issues related to widgets & Accelerators Widgets Product This label groups issues related to widgets Enhancement New feature or request and removed Bug Something isn't working labels Oct 9, 2024
@rahulbarwal rahulbarwal added Bug Something isn't working ok-to-test Required label for CI and removed Enhancement New feature or request labels Oct 9, 2024
@github-actions github-actions bot added Enhancement New feature or request Bug Something isn't working and removed Bug Something isn't working labels Oct 9, 2024
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

🧹 Outside diff range and nitpick comments (1)
app/client/src/workers/Evaluation/evalTreeWithChanges.ts (1)

142-142: Well done, class! Let's discuss this addition.

Good job on adding the inverse dependencies to the default response. This change aligns perfectly with our lesson plan of addressing the table loader issue. However, let's consider a few things:

  1. Have you thought about the performance impact of including the entire inverseDependencies object in every response?
  2. How does this change affect the data flow in our application? Are there any downstream components that might need to be updated to handle this new information?
  3. It might be helpful to add a comment explaining the purpose of this addition for future students... I mean, developers.

Class, for your homework, please consider documenting this change and its implications in our project wiki. It's important for everyone to understand why we made this change and how it affects our application's architecture.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 98ca412 and a0a51a0.

📒 Files selected for processing (2)
  • app/client/src/workers/Evaluation/evalTreeWithChanges.test.ts (1 hunks)
  • app/client/src/workers/Evaluation/evalTreeWithChanges.ts (1 hunks)
🧰 Additional context used

Copy link
Contributor

@rishabhrathod01 rishabhrathod01 left a comment

Choose a reason for hiding this comment

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

Changes LGTM

@github-actions github-actions bot added Bug Something isn't working and removed Bug Something isn't working labels Oct 10, 2024
@rahulbarwal rahulbarwal removed the ok-to-test Required label for CI label Oct 10, 2024
@rahulbarwal rahulbarwal added the ok-to-test Required label for CI label Oct 10, 2024
@github-actions github-actions bot added the Bug Something isn't working label Oct 10, 2024
@rahulbarwal
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@rahulbarwal rahulbarwal changed the title feat: Add inverse dependencies to default response in evaluateAndGenerateResponse fix: Add inverse dependencies to default response in evaluateAndGenerateResponse Oct 10, 2024
@github-actions
Copy link

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

@github-actions github-actions bot removed the Enhancement New feature or request label Oct 10, 2024
@github-actions
Copy link

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

@rahulbarwal rahulbarwal merged commit cda8131 into release Oct 10, 2024
@rahulbarwal rahulbarwal deleted the fix-36538/table-loader-not-working branch October 10, 2024 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Low An issue that is neither critical nor breaks a user flow ok-to-test Required label for CI Table Widget V2 Issues related to Table Widget V2 Widgets & Accelerators Pod Issues related to widgets & Accelerators Widgets Product This label groups issues related to widgets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Table loader not working

2 participants