Skip to content

miner-fs: Fix deletion of not yet extracted files

Carlos Garnacho requested to merge wip/carlosg/delete-not-yet-indexed into master

If a file is indexable, first tracker-miner-fs adds the nfo:FileDataObject data in both the filesystem and content graphs, then tracker-extract adds the nie:InformationElement and sets up the nie:interpretedAs/nie:isStoredAs relationship.

It is in the gap between those things happening that our query to delete files would not really delete the nfo:FileDataObject from the content graph, since there is no nie:isStoredAs property to match yet. This could be triggered by a quick file creation+deletion, before tracker-extract had a chance to extract metadata for it, and would result in tracker-extract being fairly confused about the file "being" and not being.

Fix the delete query, so it matches the nfo:FileDataObject explicitly, and leaves the nie:InformationElement match into OPTIONAL{} clauses. This will result in the definitive deletion of the content graph nfo:FileDataObject.

This was introduced in the move to GResource for file update operations.

Fixes: 0f3de321 ("tracker-miner-fs: Handle file deletion through statement in a GResource")

Merge request reports