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 610812 - Tagging a none indexed file fails silently
Tagging a none indexed file fails silently
Status: RESOLVED FIXED
Product: tracker
Classification: Core
Component: Store
git master
Other Linux
: Normal normal
: ---
Assigned To: tracker-general
Jamie McCracken
Depends on:
Blocks:
 
 
Reported: 2010-02-23 14:01 UTC by Ivan Frade
Modified: 2010-03-04 17:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
This should resolve the issue. (3.56 KB, patch)
2010-02-24 13:39 UTC, Michele Tameni
none Details | Review

Description Ivan Frade 2010-02-23 14:01:36 UTC
Steps to reproduce:

# This file hasn't been indexed by tracker
tracker-tag -a test ~/library/books/fresh/some.djvu
Tag was added successfully

tracker-info ~/library/books/fresh/some.djvu
Querying information for entity:'/home/lex/library/books/fresh/some.djvu'
Results: 0

tracker-tag -st test
Tag: 1 (shown by name)
 test
   urn:uuid:eea72e1b-34f5-9d6e-a844-b9d823ad0fbd
   0 files

# This url is the nao:Tag object, so it is creating the nao:Tag but not linking it with the actual file
Comment 1 Michele Tameni 2010-02-24 13:39:01 UTC
Created attachment 154587 [details] [review]
This should resolve the issue.
Comment 2 Jürg Billeter 2010-02-25 14:22:26 UTC
The patch creates stub FileDataObject resources if the file is unknown to tracker (and possibly doesn't exist). I"d have expected it to print an error message. Which approach should we pursue here?
Comment 3 Michele Tameni 2010-02-25 15:12:26 UTC
We can check if file exist before adding the FileDataObject stub insert, and print an error if file[s] dosn't exist.
About creating the FileDataObject stub i'm not sure on wich metadata add here, possibly if the file isn't yet in the store can be useful to get metadata from that.
Comment 4 Ivan Frade 2010-02-25 17:33:49 UTC
It should be an error instead of a mock FileDataObject:

1. If the user did a typo writing it should fail, not set the tag to a wrong URI
2. We cannot detect the typo, because we cannot rely on the real existence of the file. tracker-tag can tag also "virtual" resources as a Contact.

So the only solution is to fail if the URL doesn't exist in tracker already.
Comment 5 Michele Tameni 2010-02-26 12:55:01 UTC
tagging "virtual" resources are in the scope of tracker-tag? 
Looking in the code it seem it's more file oriented.
How a user can know the urn of a virtual resource for tag it?
Comment 6 Ivan Frade 2010-02-26 15:45:45 UTC
(In reply to comment #5)
> tagging "virtual" resources are in the scope of tracker-tag? 
> Looking in the code it seem it's more file oriented.

Historical reasons. Originally tracker was file-oriented. Now it is "resource-oriented" and well, maybe the tool are not completely up-to-date

> How a user can know the urn of a virtual resource for tag it?

Using tracker-info or tagging "http://www.nokia.com" ... he is a non-basic user if is messing things in the terminal.
Comment 7 Carlos Garnacho 2010-03-04 13:49:44 UTC
This has been fixed in commit c77476694be9d22510bda3b9ff62d91230382929, now in master. Now tracker-tag will do a report for each of the passed files in both --add and --delete.