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
Delete check parent links #124
Conversation
var multiple = false; | ||
var links = {}; | ||
data.data.forEach(function(link){ | ||
var childId = link.child.type + link.child.id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if I understand the dialog correctly as soon as one image has more than one parent the warning is displayed. So the loop could be stop as soon as multiple is true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I want to break out of the loop early then I have to switch to using a for loop
, which is slightly less nice coding style (I prefer the 'functional' style). I don't think you will notice much performance improvement to break early but can refactor if you want?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i understand but we have seen cases where people were trying to delete a large number of objects from the UI
so it will be good to see if it makes a major change in performance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is running after we make a call to the server, which takes e.g. 162 millisecs for 46 images (just tried that). I imagine the refactor will save maybe a few millisecs and won't be noticed compared to the time to load the data. With a large number of images the effect will be even smaller since it will take longer to load the data.
If you want me to spend time to analyse the performance under various conditions (for loop vv forEach and many images where the first has multiple parents vv many images where none of the images have multiple parents (so we don't break early) then I can do, but I think that would not be the best use of time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for checking
If you want me to spend time to analyse the performance under various conditions (for loop vv forEach and many images where the first has multiple parents vv many images where none of the images have multiple parents (so we don't break early) then I can do, but I think that would not be the best use of time.
This is not what I was suggesting. Nonetheless we need to keep in mind performance and large volume since it is the reality! and break early if required.
For this call, it seems that we might not have a significant performance degradation.
Unfortunately this will partially prevent the lost of image data.
|
@jburel If you delete a Dataset, any Images in it that are also in another Dataset won't get deleted. |
I got mislead by the UI, you are correct |
The UI bug should be fixed |
@jburel That last commit should fix the bug you noticed. |
Thanks @will-moore , the shared image is now removed from the second dataset when the first dataset is deleted. |
See https://forum.image.sc/t/caution-with-copy-links-in-omero/33680
We do a simple check for multiple parents and if found, show a Warning message:
To test: