Kitware / UPennContrast

UPenn ?
https://upenn-contrast.netlify.com/
Apache License 2.0
8 stars 6 forks source link

createMultipleAnnotations has a bug if you include annotationIds in the input set of annotations #782

Open arjunrajlab opened 2 months ago

arjunrajlab commented 2 months ago

createMultipleAnnotations allows you to send a list of annotations for addition to the server. However, in that call, if the annotations contain an _id key/value, it will upload but get confused. I have found, for instance, that connections between the annotations will no longer work. I am guessing this is because it screws up the commit to the database because it has an existing _id but is also trying to assign a new one or something like that. It would be better, I think, to strip any _id keys that are sent to the server via this endpoint.

This came up in the AI worker where I want to get a list of annotations and then send those same annotations back to the server, resulting in strange behavior. When I removed the _id fields from the annotations I sent with createMultipleAnnotations, it worked fine. It's probably good practice to not send the _id fields to this endpoint, but still, I think the server should catch this error.