Categories filter at Categories assignment is desynced
Posted: Tue Jul 22, 2014 8:10 am
Steps:
0. (setup) make sure that no image is assigned to Cat1
1. Click to select img01.jpg
2. Assign to it the category Cat1
3. Click to select img02.jpg
4. Assign to it the category Cat1
5. Without doing anything else, go to Categories Filter and click on the Cat1 to show the assigned photos.
Expected:
In the Categories Filter the Cat1's count should show (2).
When we click on Cat1 we must see 2 pictures (img01 and img02).
Actual:
In the Categories Filter the Cat1's count shows (1).
When we click on Cat1 we see one picture (img01).
Cause:
Most probably because the reason stems in the fact that the categories are actually written to DB when a certain signal occurs (the next photo is selected? - OnSelectionChange or similar?). I think that besides that there must be hook other signals for this - at least OnFocusLost or similar.
Also, I'm seriously thinking that the best solution is to write the categories immediately when they are assigned. This is because nowadays the SQLite's cache together with OSes caches together with HDD/SSD caches together with the general computer speed are waaaaaaay over of the need to write a category on several images. (Remember that by far the weakest/slowest link here is the human which enters the keywords from his keyboard). Of course, is better to have also a transactional/batch mode like the one which we have now but I'm afraid of data loss and other problems (like the above) in this scenario.
0. (setup) make sure that no image is assigned to Cat1
1. Click to select img01.jpg
2. Assign to it the category Cat1
3. Click to select img02.jpg
4. Assign to it the category Cat1
5. Without doing anything else, go to Categories Filter and click on the Cat1 to show the assigned photos.
Expected:
In the Categories Filter the Cat1's count should show (2).
When we click on Cat1 we must see 2 pictures (img01 and img02).
Actual:
In the Categories Filter the Cat1's count shows (1).
When we click on Cat1 we see one picture (img01).
Cause:
Most probably because the reason stems in the fact that the categories are actually written to DB when a certain signal occurs (the next photo is selected? - OnSelectionChange or similar?). I think that besides that there must be hook other signals for this - at least OnFocusLost or similar.
Also, I'm seriously thinking that the best solution is to write the categories immediately when they are assigned. This is because nowadays the SQLite's cache together with OSes caches together with HDD/SSD caches together with the general computer speed are waaaaaaay over of the need to write a category on several images. (Remember that by far the weakest/slowest link here is the human which enters the keywords from his keyboard). Of course, is better to have also a transactional/batch mode like the one which we have now but I'm afraid of data loss and other problems (like the above) in this scenario.