fix: Add inverse dependencies to default response in evaluateAndGenerateResponse (#36780)
## Description <ins>Problem</ins> Table loader was not coming up when relaod was linked to any event other than page reload. <ins>Root cause</ins> 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](https://theappsmith.slack.com/archives/C05M5CTRHM3/p1728455111179839?thread_ts=1728455103.864849&cid=C05M5CTRHM3) <ins>Solution</ins> 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 <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/11269940675> > Commit: 675e0f29ad24c86156c66920ae664727c2a5c86a > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11269940675&attempt=2" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Thu, 10 Oct 2024 10:32:29 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## 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. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
parent
00981e339b
commit
cda8131e97
|
|
@ -277,6 +277,11 @@ describe("evaluateAndGenerateResponse", () => {
|
|||
[],
|
||||
[],
|
||||
);
|
||||
|
||||
expect(webworkerResponse.workerResponse.dependencies).toEqual({
|
||||
"Text1.text": ["Text2.text", "Text1"],
|
||||
"Text2.text": ["Text2"],
|
||||
});
|
||||
const parsedUpdates =
|
||||
getParsedUpdatesFromWebWorkerResp(webworkerResponse);
|
||||
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@ export const evaluateAndGenerateResponse = (
|
|||
);
|
||||
|
||||
defaultResponse.staleMetaIds = updateResponse.staleMetaIds;
|
||||
defaultResponse.dependencies = dataTreeEvaluator.inverseDependencies;
|
||||
|
||||
// when additional paths are required to be added as updates, we extract the updates from the data tree using these paths.
|
||||
const additionalUpdates = getNewDataTreeUpdates(
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user