Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

batching update success #37915

Closed
wants to merge 2 commits into from
Closed

batching update success #37915

wants to merge 2 commits into from

Conversation

vsvamsi1
Copy link
Contributor

@vsvamsi1 vsvamsi1 commented Dec 3, 2024

Description

Tip

Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team).

Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR.

Fixes #Issue Number
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

Caution

🔴 🔴 🔴 Some tests have failed.
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/12138074816
Commit: 1e0a363
Cypress dashboard.
Tags: @tag.All
Spec:
The following are new failures, please fix them before merging the PR:

  1. cypress/e2e/Regression/Apps/CommunityIssues_Spec.ts
  2. cypress/e2e/Regression/Apps/MongoDBShoppingCart_spec.ts
  3. cypress/e2e/Regression/Apps/PromisesApp_spec.js
  4. cypress/e2e/Regression/ClientSide/Anvil/AnvilModal_spec.ts
  5. cypress/e2e/Regression/ClientSide/Autocomplete/JS_AC1_spec.ts
  6. cypress/e2e/Regression/ClientSide/Binding/InputWidget_TableV2_Sorting_spec.js
  7. cypress/e2e/Regression/ClientSide/Binding/InputWidget_Table_Sorting_spec.js
  8. cypress/e2e/Regression/ClientSide/Binding/MultiSelect_Button_Text_spec.js
  9. cypress/e2e/Regression/ClientSide/Binding/Promises_2_Spec.ts
  10. cypress/e2e/Regression/ClientSide/Binding/SelectWidget_Spec.ts
  11. cypress/e2e/Regression/ClientSide/Binding/TableV2_ClientSide_Search_spec.js
  12. cypress/e2e/Regression/ClientSide/Binding/Table_ClientSide_Search_spec.js
  13. cypress/e2e/Regression/ClientSide/BugTests/AllWidgets_Reset_Spec.ts
  14. cypress/e2e/Regression/ClientSide/BugTests/Moment_Spec.ts
  15. cypress/e2e/Regression/ClientSide/BugTests/Widget_Bug27119_Spec.ts
  16. cypress/e2e/Regression/ClientSide/DynamicHeight/DynamicHeight_Visibility_spec.ts
  17. cypress/e2e/Regression/ClientSide/FormNativeToRawTests/MongoConversion_spec.ts
  18. cypress/e2e/Regression/ClientSide/Git/ExistingApps/v1.9.24/DSCrudAndBindings_Spec.ts
  19. cypress/e2e/Regression/ClientSide/OneClickBinding/TableWidget/OneClickBindingMysql_spec.ts
  20. cypress/e2e/Regression/ClientSide/OneClickBinding/TableWidget/Table_MongoDB_spec.ts
  21. cypress/e2e/Regression/ClientSide/PublishedApps/PublishedModeToastToggle_Spec.ts
  22. cypress/e2e/Regression/ClientSide/Widgets/Audio/audio_spec.js
  23. cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckBoxGroupTest.ts
  24. cypress/e2e/Regression/ClientSide/Widgets/CurrencyInput/CurrencyInputTest.ts
  25. cypress/e2e/Regression/ClientSide/Widgets/Divider/Widget_Divider_spec.ts
  26. cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePickerV2_CSV_spec.js
  27. cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FormBindings_spec.js
  28. cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_HiddenFields_1_spec.js
  29. cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_HiddenFields_2_spec.js
  30. cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_RadioGroupField_spec.js
  31. cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_UnicodeKeys_spec.js
  32. cypress/e2e/Regression/ClientSide/Widgets/List/List7_spec.js
  33. cypress/e2e/Regression/ClientSide/Widgets/ListV2/DefaultSelectItem_spec.ts
  34. cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_SerververSide_spec.js
  35. cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_Meta_Hydration_ClientSide_spec.js
  36. cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_Meta_Hydration_ServerSide_spec.js
  37. cypress/e2e/Regression/ClientSide/Widgets/Migration_Spec.js
  38. cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_Widget_With_Button_spec.ts
  39. cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_functionaliy_spec.js
  40. cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_spec.ts
  41. cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiSelect5_spec.ts
  42. cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiTreeSelect_2_spec.ts
  43. cypress/e2e/Regression/ClientSide/Widgets/Others/IconButton_2_spec.ts
  44. cypress/e2e/Regression/ClientSide/Widgets/PhoneInput/PhoneInput_Part2_spec.ts
  45. cypress/e2e/Regression/ClientSide/Widgets/Select/Select2_Spec.ts
  46. cypress/e2e/Regression/ClientSide/Widgets/Select/Select3_Spec.ts
  47. cypress/e2e/Regression/ClientSide/Widgets/Sliders/CategorySlider_spec.ts
  48. cypress/e2e/Regression/ClientSide/Widgets/Sliders/NumberSlider_spec.ts
  49. cypress/e2e/Regression/ClientSide/Widgets/Sliders/RangeSlider_spec.ts
  50. cypress/e2e/Regression/ClientSide/Widgets/Switch/Switch2_spec.ts
  51. cypress/e2e/Regression/ClientSide/Widgets/Switch/SwitchGroup1_spec.ts
  52. cypress/e2e/Regression/ClientSide/Widgets/Tab_reset_spec.js
  53. cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableFilter1_1_Spec.ts
  54. cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableFilter1_2_Spec.ts
  55. cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableFilter2_1_Spec.ts
  56. cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableFilter2_2_Spec.ts
  57. cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Switch_spec.js
  58. cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_spec.js
  59. cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_tabledata_schema_spec.js
  60. cypress/e2e/Regression/ClientSide/Widgets/TableV2/Date_column_types_validation_spec.ts
  61. cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_2_spec.js
  62. cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js
  63. cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_1_Spec.ts
  64. cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_2_Spec.ts
  65. cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_1_Spec.ts
  66. cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_2_Spec.ts
  67. cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_DisplayText_spec.ts
  68. cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_FilteredTableData_spec.ts
  69. cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_PropertyPane_2_spec.js
  70. cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Sorting_spec.js
  71. cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Switch_spec.js
  72. cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_spec.js
  73. cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_tabledata_schema_spec.js
  74. cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/currency_spec.ts
  75. cypress/e2e/Regression/ClientSide/Widgets/TableV2/inline_editing_validations_spec.js
  76. cypress/e2e/Regression/ClientSide/Widgets/TreeSelect/Tree_Select_2_spec.ts
  77. cypress/e2e/Regression/ClientSide/Widgets/Video/Video_spec.ts
  78. cypress/e2e/Regression/ServerSide/Datasources/Firestore_Basic_Spec.ts
  79. cypress/e2e/Regression/ServerSide/GenerateCRUD/MongoURI_Spec.ts
  80. cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL2_Spec.ts
  81. cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres2_Spec.ts
  82. cypress/e2e/Regression/ServerSide/OnLoadTests/OnLoadActions_Spec.ts
  83. cypress/e2e/Regression/ServerSide/QueryPane/Mongo1_spec.ts
  84. cypress/e2e/Regression/ServerSide/QueryPane/QueryPane_Postgres_Spec.js
  85. cypress/e2e/Regression/ServerSide/QueryPane/Querypane_Mongo_Spec.js
  86. cypress/e2e/Regression/ServerSide/QueryPane/S3_1_spec.js
  87. cypress/e2e/Regression/ServerSide/QueryPane/S3_2_spec.ts
List of identified flaky tests.
Tue, 03 Dec 2024 12:11:47 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Introduced a new action type for consolidated batch updates.
    • Added functionality to capture and dispatch actions in batches within a specified time period.
  • Bug Fixes

    • Enhanced error handling mechanisms during action execution.
  • Documentation

    • Updated constants and action types to reflect new consolidated batch update handling.

@vsvamsi1 vsvamsi1 added the ok-to-test Required label for CI label Dec 3, 2024
@vsvamsi1 vsvamsi1 self-assigned this Dec 3, 2024
@vsvamsi1 vsvamsi1 requested a review from ayushpahwa as a code owner December 3, 2024 10:42
@vsvamsi1 vsvamsi1 requested a review from rajatagrawal December 3, 2024 10:42
Copy link
Contributor

coderabbitai bot commented Dec 3, 2024

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The changes in this pull request involve updates to Redux action constants and the introduction of a new generator function in the PluginActionSaga.ts file. Specifically, the action type BATCH_UPDATES_SUCCESS is replaced with BATCH_UPDATES_SUCCESS_CONSOLIDATED across relevant files, reflecting a consolidation in handling batch updates. Additionally, a new function is added to capture and dispatch actions over a specified time period, enhancing action execution and error handling without altering existing functionalities.

Changes

File Path Change Summary
app/client/src/ce/actions/evaluationActionsList.ts - Updated LINT_REDUX_ACTIONS to use BATCH_UPDATES_SUCCESS_CONSOLIDATED.
- Commented out previous BATCH_UPDATES_SUCCESS in EVALUATE_REDUX_ACTIONS and added the new action type.
app/client/src/ce/constants/ReduxActionConstants.tsx - Added new constant BATCH_UPDATES_SUCCESS_CONSOLIDATED in BatchUpdateActionTypes.
app/client/src/sagas/ActionExecution/PluginActionSaga.ts - Introduced captureActionsWithinPeriodTriggers function for batching actions.
- Updated watchPluginActionExecutionSagas to trigger this new function on START_EVALUATION.

Possibly related PRs

Suggested labels

Bug, Frontend, High, Production, Needs Triaging, Query & JS Pod, Integrations Product, QA

Suggested reviewers

  • dvj1988
  • ayushpahwa
  • rishabhrathod01

🎉 In the code's dance, a new step we find,
Batching actions together, all perfectly aligned.
Redux now flows with a rhythm so grand,
Consolidated updates, a well-crafted plan.
With functions that capture in a timely embrace,
Our actions unite, keeping pace in the race! 🎶


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 generate docstrings to generate docstrings for this PR. (Experiment)
  • @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.

@vsvamsi1 vsvamsi1 marked this pull request as draft December 3, 2024 10:43
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 (2)
app/client/src/sagas/ActionExecution/PluginActionSaga.ts (1)

1698-1699: Remove unnecessary ESLint directive

The eslint-disable-next-line prefer-const comment is not associated with any code. Since there is no variable declaration following it, this directive can be removed to clean up the code.

app/client/src/ce/actions/evaluationActionsList.ts (1)

99-99: Remove commented-out action type

The line commenting out ReduxActionTypes.BATCH_UPDATES_SUCCESS is no longer needed and can be removed to keep the codebase clean.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 008a946 and 96ceaf6.

📒 Files selected for processing (3)
  • app/client/src/ce/actions/evaluationActionsList.ts (2 hunks)
  • app/client/src/ce/constants/ReduxActionConstants.tsx (1 hunks)
  • app/client/src/sagas/ActionExecution/PluginActionSaga.ts (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • app/client/src/ce/constants/ReduxActionConstants.tsx

Comment on lines 1741 to 1744
takeEvery(
ReduxActionTypes.START_EVALUATION,
captureActionsWithinPeriodTriggers,
),
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Ensure a single instance of 'captureActionsWithinPeriodTriggers'

Using takeEvery with ReduxActionTypes.START_EVALUATION may start multiple instances of captureActionsWithinPeriodTriggers if START_EVALUATION is dispatched multiple times. To prevent concurrent executions, consider using takeLatest to ensure only one instance runs at a time.

Apply this diff to modify the saga effect:

-    takeEvery(
+    takeLatest(
      ReduxActionTypes.START_EVALUATION,
      captureActionsWithinPeriodTriggers,
    ),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
takeEvery(
ReduxActionTypes.START_EVALUATION,
captureActionsWithinPeriodTriggers,
),
takeLatest(
ReduxActionTypes.START_EVALUATION,
captureActionsWithinPeriodTriggers,
),

Copy link

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

@github-actions github-actions bot added the Stale label Dec 10, 2024
Copy link

This PR has been closed because of inactivity.

@github-actions github-actions bot closed this Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Required label for CI Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant