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

fix: resolve redundant JSObject action saving #36958

Merged
merged 6 commits into from
Oct 24, 2024

Conversation

rishabhrathod01
Copy link
Contributor

@rishabhrathod01 rishabhrathod01 commented Oct 17, 2024

Description

In this change, we avoid storing duplicate actions or variables in the parsedBody after AST parsing. This prevents duplicate actions from being sent to the server on save.

This change also removes parsedFunction from the action object of parsedBody as it is not being used.

Fixes #36879

Test Cases

  • After parsing JS Object make sure parsedBody doesn't have duplicate actions or variables

Automation

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

🔍 Cypress test results

Tip

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


Wed, 23 Oct 2024 18:20:11 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Introduced enhanced methods for creating, updating, and moving action collections, improving validation and consistency.
    • Added a new interface for better handling of JavaScript actions and variables, enhancing data processing efficiency.
  • Bug Fixes

    • Improved error reporting from pages to collections, ensuring accurate tracking of action errors.
    • Added tests to ensure duplicate actions are correctly handled during updates.
  • Documentation

    • Updated comments and documentation for clarity on new functionalities and changes.

@github-actions github-actions bot added the Bug Something isn't working label Oct 17, 2024
@rishabhrathod01
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

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

Copy link

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

@github-actions github-actions bot added Javascript Product Issues related to users writing javascript in appsmith JS Objects Issues related to JS Objects Needs Triaging Needs attention from maintainers to triage Query & JS Pod Issues related to the query & JS Pod labels Oct 17, 2024
@rishabhrathod01 rishabhrathod01 added the ok-to-test Required label for CI label Oct 17, 2024
@rishabhrathod01 rishabhrathod01 marked this pull request as ready for review October 18, 2024 06:43
Copy link
Contributor

coderabbitai bot commented Oct 18, 2024

Walkthrough

The changes introduce a new interface ParseJSAction and modify the saveResolvedFunctionsAndJSUpdates function to improve how actions and variables are managed. The previous arrays for actions and variables are replaced with maps to prevent duplicates. Additionally, new tests are added to verify that the function correctly handles duplicate entries. The overall structure and error handling remain consistent, with minor adjustments to comments and formatting.

Changes

File Path Change Summary
app/client/src/workers/Evaluation/JSObject/index.ts Added interface ParseJSAction and modified saveResolvedFunctionsAndJSUpdates to use maps for actions and variables. Removed comments about future fixes for type handling.
app/client/src/workers/Evaluation/JSObject/test.ts Added tests for saveResolvedFunctionsAndJSUpdates, including handling of duplicate actions and variables. Introduced types JSUpdate, JSActionEntity, and JSActionEntityConfig.

Assessment against linked issues

Objective Addressed Explanation
Address duplicate JS Object action creation issue (#36879)
Ensure updates are sent to the server for body changes (#36879)

Possibly related PRs

Suggested labels

Critical, Production, Community Reported, Help enterprise

Suggested reviewers

  • dvj1988

🎉 In the land of code where functions play,
A new interface brightens the way.
With maps to keep duplicates at bay,
We save resolved functions without delay!
Tests now ensure all's in the fray,
In the world of JS, we dance and sway! 🎉


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.

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 (3)
app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/LayoutCollectionServiceCEImpl.java (3)

Line range hint 138-138: Remove redundant assignment of unpublishedCollection

The actionCollection.setUnpublishedCollection(collectionDTO); call at line 138 is redundant since it's already set at line 121. Consider removing the duplicate assignment to streamline the method.


Line range hint 139-145: Handle exceptions in action updates appropriately

In the moveCollection method, within the actionUpdatesFlux, exceptions during updateUnpublishedAction are caught and logged, but the error is suppressed by returning Mono.empty(). This might lead to silent failures. Consider propagating the exception or implementing a fallback mechanism to ensure that failures are not overlooked.


Line range hint 386-388: Remove unnecessary mapping operation

The .map(updatedBranchedActionCollection -> { return updatedBranchedActionCollection; }) in sendErrorReportsFromPageToCollection doesn't modify the data. You can remove this mapping step to simplify the reactive chain.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between e5e6989 and 4276fd9.

📒 Files selected for processing (1)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/LayoutCollectionServiceCEImpl.java (1 hunks)
🧰 Additional context used

Comment on lines 320 to 323
.distinct(actionDTO -> actionCollectionDTO.getName() + "." + actionDTO.getName())
.flatMap(actionDTO -> {
actionDTO.setDeletedAt(null);
setContextId(branchedActionCollection, actionDTO);
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Simplify initialization of baseActionIds

You create a new HashSet called baseActionIds and add all elements from validBaseActionIds. Since validBaseActionIds is already a set, you can use it directly or instantiate baseActionIds with new HashSet<>(validBaseActionIds) to simplify the code.

@rishabhrathod01
Copy link
Contributor Author

rishabhrathod01 commented Oct 18, 2024

image

Executing both functions always executes the 2nd function body part, according to this we show an error for the 2nd function. We should avoid overriding the first function definition.

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

🧹 Outside diff range and nitpick comments (2)
app/client/src/ce/entities/DataTree/dataTreeJSAction.ts (2)

58-60: Approved: Good addition to prevent duplicate actions.

This check effectively prevents duplicate actions from being added to the data tree, aligning with the PR's objective.

Consider using Object.prototype.hasOwnProperty for a slight performance boost:

- if (actionsData[action.name]) continue;
+ if (Object.prototype.hasOwnProperty.call(actionsData, action.name)) continue;

This change ensures we're checking the object's own properties, not inherited ones.


58-60: Overall impact: Positive change with minimal risk.

The modification effectively prevents duplicate actions without affecting other parts of the function. It's a targeted fix that addresses the issue at hand.

For improved clarity, consider adding a brief comment explaining why we're skipping duplicate actions:

+ // Skip duplicate actions to prevent redundant entries in the data tree
  if (actionsData[action.name]) continue;

This comment would help future developers understand the rationale behind this check.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 4276fd9 and d89f9d7.

📒 Files selected for processing (1)
  • app/client/src/ce/entities/DataTree/dataTreeJSAction.ts (1 hunks)
🧰 Additional context used

@rishabhrathod01
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

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

Copy link

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

Copy link
Contributor Author

@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.

image

Executing both functions always executes the 2nd function body part, according to this we show an error for the 2nd function. We should avoid overriding the first function definition.

Issues still retains fix this before merging.

@rishabhrathod01
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

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

Copy link

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

@rishabhrathod01 rishabhrathod01 requested review from sneha122 and removed request for ApekshaBhosale October 21, 2024 09:32
@sneha122
Copy link
Contributor

@rishabhrathod01 Should we add unit test cases for the changes?

@rishabhrathod01
Copy link
Contributor Author

@rishabhrathod01 Should we add unit test cases for the changes?

Yes, let me add unit test for both the changes.

@rishabhrathod01 rishabhrathod01 removed the request for review from NilanshBansal October 22, 2024 08:18
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

🧹 Outside diff range and nitpick comments (1)
app/server/appsmith-server/src/test/java/com/appsmith/server/services/ActionCollectionServiceImplTest.java (1)

414-463: LGTM. Consider adding an assertion for action properties.

The new test method effectively verifies that duplicate actions are handled correctly. Good job on covering this edge case.

Consider adding an assertion to verify that the action's properties (e.g., clientSideExecution) are preserved after the update. This would ensure that the de-duplication process doesn't inadvertently modify the action's attributes.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between c8be91e and d5c1e64.

📒 Files selected for processing (1)
  • app/server/appsmith-server/src/test/java/com/appsmith/server/services/ActionCollectionServiceImplTest.java (1 hunks)
🧰 Additional context used

Copy link

Failed server tests

  • com.appsmith.server.services.ActionCollectionServiceImplTest#testUpdateUnpublishedActionCollection_withDuplicateActions

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 (4)
app/client/src/workers/Evaluation/JSObject/test.ts (2)

150-159: Enhance test case clarity and structure.

While the test correctly validates duplicate handling, consider these improvements:

  1. Make the test description more specific about what constitutes "correct" updates
  2. Consider breaking down the large test data into smaller, focused test cases for different scenarios (e.g., duplicate variables vs duplicate actions)

155-155: Improve test data quality and readability.

The JSObject body contains syntax errors and poorly formatted code. Consider:

  1. Using properly formatted and syntactically correct JavaScript
  2. Using template literals for better readability
  3. Using realistic function bodies that better represent actual use cases

Example of improved body format:

const body = `
export default {
  myVar1: [],
  myVar1: [], // Intentional duplicate
  myVar2: {},
  myFun1: () => {
    // First function
    return true;
  },
  myFun2: () => {
    // Intentional duplicate function
    return false;
  },
  myFun2: () => {
    // Intentional duplicate function
    return true;
  }
}`;

Also applies to: 167-167

app/client/src/workers/Evaluation/JSObject/index.ts (2)

122-122: Simplify boolean coercion

The double negation (!!) is redundant here as parsedObject will already be coerced to a boolean in this context.

-          if (!!parsedObject) {
+          if (parsedObject) {
🧰 Tools
🪛 Biome

[error] 122-122: Avoid redundant double-negation.

It is not necessary to use double-negation when a value will already be coerced to a boolean.
Unsafe fix: Remove redundant double-negation

(lint/complexity/noExtraBooleanCast)


Line range hint 172-174: Consider adding error logging

The empty catch block could hide important errors. Consider at least logging the error or adding it to dataTreeEvalRef.errors.

-              } catch {
-                // in case we need to handle error state
+              } catch (error) {
+                dataTreeEvalRef.errors.push({
+                  type: EvalErrorTypes.PARSE_JS_ERROR,
+                  context: {
+                    entity: entity,
+                    propertyPath: `${entityName}.${parsedElement.key}`,
+                  },
+                  message: error.message,
+                });
               }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between d5c1e64 and c12ee70.

📒 Files selected for processing (2)
  • app/client/src/workers/Evaluation/JSObject/index.ts (4 hunks)
  • app/client/src/workers/Evaluation/JSObject/test.ts (2 hunks)
🧰 Additional context used
🪛 Biome
app/client/src/workers/Evaluation/JSObject/index.ts

[error] 122-122: Avoid redundant double-negation.

It is not necessary to use double-negation when a value will already be coerced to a boolean.
Unsafe fix: Remove redundant double-negation

(lint/complexity/noExtraBooleanCast)

🔇 Additional comments (4)
app/client/src/workers/Evaluation/JSObject/test.ts (1)

1-11: LGTM: Import statements are well-organized.

The new imports correctly support the added test functionality for handling duplicate JSObject actions.

app/client/src/workers/Evaluation/JSObject/index.ts (3)

118-119: LGTM: Effective use of maps to prevent duplicates

Using maps with action/variable names as keys is an elegant solution to prevent duplicate entries while maintaining O(1) lookup performance.


126-127: LGTM: Effective duplicate prevention

The early return when encountering duplicate actions aligns with the PR's objective of preventing redundant action saving.


197-198: Verify array order consistency

The conversion from map to array using Object.values() looks good, but we should verify that the order of actions doesn't affect any downstream consumers.

@rishabhrathod01 rishabhrathod01 requested review from sneha122 and removed request for nidhi-nair and sondermanish October 23, 2024 17:46
@rishabhrathod01
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

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

Copy link

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

Copy link

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

@rishabhrathod01 rishabhrathod01 merged commit 5d571b9 into release Oct 24, 2024
57 checks passed
@rishabhrathod01 rishabhrathod01 deleted the fix/redundant-JSObject-actions branch October 24, 2024 05:57
sneha122 added a commit that referenced this pull request Nov 19, 2024
## Description

[During analysis of action creation flow
metrics](#37151 (comment)),
we observed that RefactoringService.isNameAllowed is taking 80-90% of
the total JS object action time. This PR optimises this part in a way
that for any jsobject action, instead of fetching all actions from DB
and comparing it
to see if current action name is allowed, we simply do that check in
memory where for current action collection, if any action names are
being duplicated, we throw the error.

We could make this change easily because recently we merged a
[PR](#36958) which removes
the actions with duplicate name from client payload whenever Js object
update API is called, with this change, we can guarantee that for any JS
object update call, all actions inside it will always have unique names.
This PR makes the similar check on backend where if any action has
duplicate name within collection, we throw an error and don't store that
action in the DB.

We may need to consider following test case in both before and after
implementation of this approach. This can be covered during PR testing:
What happens if the client sends multiple requests to add a new function
in an existing collection. That is, as a result of the debounce logic,
if the server receives 2 consecutive requests with a populated
collection but without actionId associated to either request.

Relevant thread:
https://theappsmith.slack.com/archives/C040LHZN03V/p1731571364933089

Fixes #37365 
_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.JS"

### 🔍 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/11911295324>
> Commit: d5c75ed
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11911295324&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.JS`
> Spec:
> <hr>Tue, 19 Nov 2024 11:14:16 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 validation to prevent the creation of actions with duplicate
names in action collections.
- Simplified handling of JavaScript actions, allowing them to bypass
certain validation checks.

- **Bug Fixes**
- Improved error handling during action updates and collection
modifications to ensure better logging and management of failures.

- **Tests**
- Added tests to verify that duplicate action names trigger appropriate
error messages, enhancing the robustness of the action collection
feature.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: “sneha122” <“[email protected]”>
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Nov 20, 2024
## Description

In this change, we avoid storing duplicate actions or variables in the
`parsedBody` after AST parsing. This prevents duplicate actions from
being sent to the server on save.

This change also removes `parsedFunction` from the action object of
parsedBody as it is not being used.

Fixes appsmithorg#36879

## Test Cases

- [x] After parsing JS Object make sure parsedBody doesn't have
duplicate actions or variables

## Automation

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

### 🔍 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/11485245933>
> Commit: c12ee70
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11485245933&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.JS`
> Spec:
> <hr>Wed, 23 Oct 2024 18:20:11 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**
- Introduced enhanced methods for creating, updating, and moving action
collections, improving validation and consistency.
- Added a new interface for better handling of JavaScript actions and
variables, enhancing data processing efficiency.

- **Bug Fixes**
- Improved error reporting from pages to collections, ensuring accurate
tracking of action errors.
- Added tests to ensure duplicate actions are correctly handled during
updates.

- **Documentation**
- Updated comments and documentation for clarity on new functionalities
and changes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Nov 20, 2024
…37391)

## Description

[During analysis of action creation flow
metrics](appsmithorg#37151 (comment)),
we observed that RefactoringService.isNameAllowed is taking 80-90% of
the total JS object action time. This PR optimises this part in a way
that for any jsobject action, instead of fetching all actions from DB
and comparing it
to see if current action name is allowed, we simply do that check in
memory where for current action collection, if any action names are
being duplicated, we throw the error.

We could make this change easily because recently we merged a
[PR](appsmithorg#36958) which removes
the actions with duplicate name from client payload whenever Js object
update API is called, with this change, we can guarantee that for any JS
object update call, all actions inside it will always have unique names.
This PR makes the similar check on backend where if any action has
duplicate name within collection, we throw an error and don't store that
action in the DB.

We may need to consider following test case in both before and after
implementation of this approach. This can be covered during PR testing:
What happens if the client sends multiple requests to add a new function
in an existing collection. That is, as a result of the debounce logic,
if the server receives 2 consecutive requests with a populated
collection but without actionId associated to either request.

Relevant thread:
https://theappsmith.slack.com/archives/C040LHZN03V/p1731571364933089

Fixes appsmithorg#37365 
_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.JS"

### 🔍 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/11911295324>
> Commit: d5c75ed
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11911295324&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.JS`
> Spec:
> <hr>Tue, 19 Nov 2024 11:14:16 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 validation to prevent the creation of actions with duplicate
names in action collections.
- Simplified handling of JavaScript actions, allowing them to bypass
certain validation checks.

- **Bug Fixes**
- Improved error handling during action updates and collection
modifications to ensure better logging and management of failures.

- **Tests**
- Added tests to verify that duplicate action names trigger appropriate
error messages, enhancing the robustness of the action collection
feature.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: “sneha122” <“[email protected]”>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Javascript Product Issues related to users writing javascript in appsmith JS Objects Issues related to JS Objects Needs Triaging Needs attention from maintainers to triage ok-to-test Required label for CI Query & JS Pod Issues related to the query & JS Pod
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Duplicate JS Object action creation and unable to delete the duplicate action
2 participants