appsmith
appsmith copied to clipboard
[Bug]: JSObject.name already exists
Is there an existing issue for this?
- [X] I have searched the existing issues
Description
Intro
After solving the JSObject.name already exists issue we’ve found another reason which causes this issue.
Description
The JS collection (actionCollection
in MongoDB) keeps all the references to the actions inside it in unpublishedCollection.defaultToBranchedActionIdsMap
.
Findings
I have found a few documents where the unpublishedCollection.defaultToBranchedActionIdsMap
is empty although there are valid actions in the newAction
collection with the corresponding collectionId
.
For this kind of documents a few users experience JSObject.name already exists issue. Because GET /api/v1/collections/actions
returns all the JS collections and associated actions in response. For the above case, the JS collection is returned but the actions array is not having any actions. So, the front end tries to create those actions through a PUT request (/api/v1/collections/actions/{collectionId})
and the server identifies these actions as already created and hence returns JSObject.name already exists message in response.
It seems like a data inconsistency.
As multiple updates or inserts take place without sharing a common transaction this might happen.
Steps To Reproduce
It's not reproducible easily as we don't have control over the server code execution flow.
Public Sample App
No response
Issue video log
No response
Version
Cloud / Self Hosted
This issue also causes the object to not appear on selection dropdown
Sample object
TC4 is the object that does not show up on action selector dropdown
Chiming in on this issue since I just encountered it at version 1.9.61.
• Current version is at v1.9.61 • This instance of Appsmith Business Edition is deployed on an AWS EC2 virtual machine. This VM is running docker off of Ubuntu 20.04.6 LTS (GNU/Linux 5.15.0-1044-aws x86_64). • This instance has access to the internet, and it can access http://cs.appsmith.com/ and http://api64.ipify.org/ . • There is a reverse proxy, and a firewall in use via cloudflare and aws respectively. • Our Mongo/Redis is internal as far as I can tell.
Function:
Query:
This dropdown calls it:
@subrata71 - Wondering if is there any update on this issue? I am seeing this on some apps even now. Here is a recording. Can this be prioritised?
https://github.com/appsmithorg/appsmith/assets/101863839/1636785a-e873-4a5b-840a-04814e1ac2ec