After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 633579 - Extension.Fixup does not clear its internal cache on problemtype-change
Extension.Fixup does not clear its internal cache on problemtype-change
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: Other Extensions
git master
Other Linux
: Normal normal
: 1.x
Assigned To: Banshee Maintainers
Banshee Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-10-30 20:32 UTC by Raimo Radczewski
Modified: 2010-11-02 00:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Implements ClearCache() method in MigoModelProvider, adds method to ProblemModel.Clear() (1.64 KB, patch)
2010-10-30 20:32 UTC, Raimo Radczewski
needs-work Details | Review
Better Patch ;-P (1.52 KB, patch)
2010-11-01 21:15 UTC, Raimo Radczewski
committed Details | Review

Description Raimo Radczewski 2010-10-30 20:32:04 UTC
Created attachment 173568 [details] [review]
Implements ClearCache() method in MigoModelProvider, adds method to ProblemModel.Clear()

When switching between Problem Types, Banshee would still list problems of the old type, e.g. switching from artist to genre would still list artist problems, altough they were cleared from the database.

The bug was caused by MigoModelProvider's internal cache, which was not cleared when the problemtype was changed, thus causing it to still return old data.

Attached is a patch that fixes this issue.

Two things to note:
1. Fixup currently doesnt work properly because of some issues with the GUI, but this doesn't affect this bug directly

2. The primary index seems to be reset everytime the problemtype is cleared, is this wanted? This indirectly caused this malfunction, as the ProblemID is used as the primary key for the internal cache
Comment 1 Gabriel Burt 2010-11-01 21:02:04 UTC
Review of attachment 173568 [details] [review]:

Please see `git log` for examples of commit msgs.  The first line should be <= 50 chars, then two line breaks, then the rest of your message, which should include the bgo#.

Besides that and the space issues below, this looks good.  Please resubmit fixed and I'll push it.

::: src/Extensions/Banshee.Fixup/Banshee.Fixup/ProblemModel.cs
@@ +140,3 @@
             selected_count = 0;
             ServiceManager.DbConnection.Execute ("DELETE FROM MetadataProblems");
+            Problem.Provider.ClearCache();

We put a space between the method name and argument list.  See HACKING for our full code style guide.
Comment 2 Raimo Radczewski 2010-11-01 21:15:38 UTC
Created attachment 173653 [details] [review]
Better Patch ;-P
Comment 3 Gabriel Burt 2010-11-02 00:21:37 UTC
Review of attachment 173653 [details] [review]:

Committed, thanks!