You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a client side issue caused by the use of Clotho.set to save objects without any checking if a duplicate ID already exists in the database.
Creating a new object via the Sharable Editor with an ID that already exists will clobber the previous object with that ID. To reproduce, simply create an object with an ID and then create another object with the same ID - the old one will be rewritten automatically.
This issue also occurs when creating an instance of a Schema, modifying some fields excluding the ID field, and saving.
The issue is caused by an invalid use of Clotho's set method, which should be used to set certain fields of an existing object, rather than used to create (and thus overwrite existing) objects.
The function scope.save which calls Clotho.set in clothoEditor.js should be modified to use a Clotho.create call, which should then trigger a prompt to the user if an object is going to be rewritten. Note that Clotho's create call has checking to see if the given ID already exists, and if it does, returns null as the ObjectId.
The text was updated successfully, but these errors were encountered:
billcao
changed the title
Lack of duplicate ID checking in Sharable Editor resulting in overwrites
Lack of duplicate ID checking in Sharable Editor results in overwrites
Feb 16, 2015
This is a client side issue caused by the use of Clotho.set to save objects without any checking if a duplicate ID already exists in the database.
Creating a new object via the Sharable Editor with an ID that already exists will clobber the previous object with that ID. To reproduce, simply create an object with an ID and then create another object with the same ID - the old one will be rewritten automatically.
This issue also occurs when creating an instance of a Schema, modifying some fields excluding the ID field, and saving.
The issue is caused by an invalid use of Clotho's set method, which should be used to set certain fields of an existing object, rather than used to create (and thus overwrite existing) objects.
The function
scope.save
which calls Clotho.set in clothoEditor.js should be modified to use a Clotho.create call, which should then trigger a prompt to the user if an object is going to be rewritten. Note that Clotho's create call has checking to see if the given ID already exists, and if it does, returns null as the ObjectId.The text was updated successfully, but these errors were encountered: