Bug 440315 - Resource tag chooser doesn't update when active bundles change.
Summary: Resource tag chooser doesn't update when active bundles change.
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Resource Management (other bugs)
Version First Reported In: git master (please specify the git hash!)
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Emmet O'Neill
URL:
Keywords: release_blocker
Depends on:
Blocks:
 
Reported: 2021-07-27 03:59 UTC by Emmet O'Neill
Modified: 2021-07-30 00:46 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Emmet O'Neill 2021-07-27 03:59:43 UTC
SUMMARY

Something is wrong with filtering resources, because despite the fact that the visible set of brush presets gets smaller as you deactivate bundles while viewing ALL tags, selecting a specific tag from the tag chooser combo box causes presets from deactivated bundles to continue to show up.

STEPS TO REPRODUCE

1. Open brush preset chooser while all bundles are enabled in the "storage resources" menu at the upper right.
2. Notice that there are 3 erasers among the presets. (Default)
3. Set the tag chooser combobox above to "Erasers".
4. You will see only the 3 eraser presets.
5. Open the "storage resources" menu at the upper right, and disable the "Krita 4 Default Resources" bundle.
6. Notice that there is now only 1 eraser preset now. (ALL tag)
7. Set the tag chooser combobox above to "Erasers", once again.
8. Count the number of erasers!

OBSERVED RESULT

3 eraser presets are still visible, despite the fact that 2 of them exist in a bundle that is no longer active.

EXPECTED RESULT

Only 1 eraser preset should be visible!

2/3 of the eraser presets belong to the "Krita 4 Default Resources" bundle, which we've deactivated. But, for some reason, they are both still visible when we set the "tag chooser" combobox above to the "Erasers" tag. 


SOFTWARE/OS VERSIONS
Fedora Linux 34
GNOME ;D
Comment 1 Emmet O'Neill 2021-07-27 04:07:06 UTC
I also want to add that this bug occurs the other way around also: if you originally open the brush preset chooser with "Krita 4 Default Resources" disabled (only a single eraser visible), and then enable that bundle before selecting "Erasers" in the tag chooser combo box above, you'll still see only 1 eraser when there should be 3!

I don't know this system that well yet, but it might hint that some aspect of the filtering is being cached (or not being refreshed/invalidated) when it should be.
Comment 2 Lynx3d 2021-07-28 12:25:43 UTC
Yeah now that I look at it, KisAllTagResourceModel does not connect to "KisStorageModel::instance(), SIGNAL(storageEnabled(const QString&)" etc. like KisAllResourceModel and KisAllTagsModel.

KisTagFilterResourceProxyModel switches between KisResourceModel and KisTagResourceModel as source depending on the filter set, but if the latter keeps getting the date of an outdated database query, it'll keep reporting the old state until something triggers a query reset.
Comment 3 Emmet O'Neill 2021-07-30 00:46:06 UTC
I resolved this as of commit a51f7ee078c006eb601883529373b0c1dccccdb5.