Attribute record not deleted when file deleted

Started by axel.hennig, September 05, 2024, 10:16:05 PM

Previous topic - Next topic

axel.hennig

Attribute record not deleted when file deleted.

Steps to reproduce:
1. Set up Attribute Set with name "Misc" (File not Global).
2. Add new Attribute "Test" (Text).
3. Choose a file and add some text to the Attribute "Test" for that file. See screenshot.
sc1.jpg

4. Open "Edit > Preferences > Edit Attributes".
5. Select the "Misc (File)" Attribute Set in the drop-down list.
6. Click the "Browse" button (top-right). The opened dialog shows the complete filepath and the Attribute text. See screenshot.
sc2.jpg

7. Close the "Edit Attribute Set 'Misc'" window as well as the "Preferences" window.
8. Delete the file (the one with the text in the Attribute "Test". File can be deleted via "CTRL + DEL" or via context menu (right click on file and select "Delete File..."). See screenshot.
sc3.jpg

9. Redo steps 4., 5. and 6. The "Edit Attribute Set 'Misc'" window does not show the filepath anymore, but still the text. This looks like a bug to me. See screenshot.
sc4.jpg

Mario

Thanks. Usually the database system was supposed to take care for that by something called delete cascade.
But the routine used by the IMatch Engine when removing a file and all dependent objects was a bit too flexible, leaving Attributes laying around for a while.

I have fixed this for the next release and added an extra step to the diagnosis which finds old orphaned Attribute records and removes them. I've also wrote an optimized delete routine for the special "file removed from database" case to squeeze out a bit more performance if many files are deleted.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook