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 760586 - new files do not show up in global search results
new files do not show up in global search results
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: search
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-01-13 17:24 UTC by Christian Hergert
Modified: 2016-03-12 23:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
file-search: update index when new file is created by buffer-manager (4.95 KB, patch)
2016-03-12 23:11 UTC, Christian Hergert
committed Details | Review

Description Christian Hergert 2016-01-13 17:24:36 UTC
Upon creating a new file (or deleting a file), the global file search index is not updated.

Originally, this was a technical issue. However, there is a fairly simple design to deal with this. "Tombstone records". We simply need to insert a tombstone when a file is deleted, and add the item when it is added.

Support for tombstones should be added to fuzzy.c, which consists of an append with a bit used to mark that the item was "deleted".

Search results should not add this to the result array.
Comment 1 Christian Hergert 2016-01-17 19:21:10 UTC
I looks like I already added tombstone support to fuzzy.[ch], so fuzzy_remove() can be used to remove an item from the fuzzy index.
Comment 2 Varun Joshi 2016-02-03 19:56:16 UTC
http://man7.org/tlpi/code/online/dist/inotify/inotify_dtree.c.html

This supports all corner cases/race conditions very well, but it fails if the directory is very large (more than 4000 folders), with the error "inotify_add_watch: No space left on device". This uses the inotify API directly, I'm currently trying to make something that uses GFileMonitor instead.
Comment 3 Christian Hergert 2016-03-12 23:11:47 UTC
Created attachment 323774 [details] [review]
file-search: update index when new file is created by buffer-manager

Long term, I think we want a better way to update the index when a file
is added to the project. But to do that, we need to introduce some signals
to IdeProject or similar structure (perhaps IdeContext).

The easiest way to fix this bug for 3.20 is to watch for the new file
being created by the buffer manager, since new files in the project tree
get immediately opened.
Comment 4 Christian Hergert 2016-03-12 23:13:00 UTC
Considering this bug fixed with the somewhat "workaround" oriented patch.

We want to investigate better ways to propagate project-wide changes in the future.

Attachment 323774 [details] pushed as 1a3795b - file-search: update index when new file is created by buffer-manager