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 683495 - search-engine: Reset duplicates cache when search finishes
search-engine: Reset duplicates cache when search finishes
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-09-06 12:59 UTC by Florian Müllner
Modified: 2012-09-06 13:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
search-engine: Reset duplicates cache when search finishes (1.34 KB, patch)
2012-09-06 12:59 UTC, Florian Müllner
reviewed Details | Review
search-engine: Reset duplicates cache when search finishes (1.68 KB, patch)
2012-09-06 13:23 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2012-09-06 12:59:34 UTC
See patch.

To reproduce:
Have a file called 'foobar', type 'foo' until the search result appears, append 'bar' to the search term - the result should obviously not disappear :-)
Comment 1 Florian Müllner 2012-09-06 12:59:37 UTC
Created attachment 223645 [details] [review]
search-engine: Reset duplicates cache when search finishes

Fixing the handling of duplicated search results in commit 7f04862
exposed a different bug: as the duplicates cache is never reset,
previously matched results are ignored in subsequent searches (e.g.
when adding/removing characters to the search terms that should not
change the result set).
Comment 2 Cosimo Cecchi 2012-09-06 13:06:05 UTC
Review of attachment 223645 [details] [review]:

::: libnautilus-private/nautilus-search-engine.c
@@ +166,3 @@
 		nautilus_search_provider_finished (NAUTILUS_SEARCH_PROVIDER (engine));
+		g_hash_table_remove_all (engine->details->uris);
+	}

Looks good, but what about the case when we error out instead? I think we should also clear caches in that case.
Comment 3 Florian Müllner 2012-09-06 13:23:44 UTC
Created attachment 223648 [details] [review]
search-engine: Reset duplicates cache when search finishes

(In reply to comment #2)
> Looks good, but what about the case when we error out instead? I think we
> should also clear caches in that case.

Yeah, sounds right - slightly off-topic: I noticed that the current code assumes that either all providers succeed or err out, is that assumption really valid?
Comment 4 Cosimo Cecchi 2012-09-06 13:33:56 UTC
Review of attachment 223648 [details] [review]:

Thanks, this looks good
Comment 5 Cosimo Cecchi 2012-09-06 13:36:36 UTC
(In reply to comment #3)

> Yeah, sounds right - slightly off-topic: I noticed that the current code
> assumes that either all providers succeed or err out, is that assumption really
> valid?

It's not; I think "error" should also imply "finished", but we don't enforce this assumption anywhere - I think we should.
Comment 6 Florian Müllner 2012-09-06 13:41:56 UTC
Attachment 223648 [details] pushed as 41714d9 - search-engine: Reset duplicates cache when search finishes