Bug 333478 - Unsetting a tag doesn't remove extended file-system-attribute
Summary: Unsetting a tag doesn't remove extended file-system-attribute
Status: RESOLVED FIXED
Alias: None
Product: Baloo
Classification: Unmaintained
Component: Tags (show other bugs)
Version: unspecified
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Vishesh Handa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-15 20:55 UTC by Holger
Modified: 2014-07-25 09:39 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Holger 2014-04-15 20:55:35 UTC
I tagged the wrong file in dolphin and removed the tag by unselecting it in the dialog that pops up from the into-panel ins Dolphin. Afterward I checked in a Konsole via

attr -l my_file.txt

It lists attribute "xdg.tags" of size 0 Bytes.

I had to manually tell the filesystem via

attr -r xdg.tags my_file.txt

Reproducible: Always

Steps to Reproduce:
1. Create/set a tag on some file
2. Remove/unset/unselect the tag again
3. Check in a console with attr -l
Actual Results:  
The attribute is not gone, only it's value was nullified.

Expected Results:  
Remove the attribute alltogether

Qt: 4.8.6
KDE: 4.13.0
Dolphin: 4.13.0

3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Comment 1 Christoph Feck 2014-04-20 09:48:00 UTC
Frank, that should be handled by Baloo, right?
Comment 2 Frank Reininghaus 2014-04-20 10:11:59 UTC
Yes.
Comment 3 Christoph Feck 2014-04-20 14:28:57 UTC
Holger, could you clarify why it is a bug? To me, it looks like a wish.
Comment 4 Holger 2014-04-22 23:35:03 UTC
@Christoph

Imagine a file-system where you cannot delete files but only set their size to zero ... leaving those empty attributes dangling around sounds like a bug to me. But you're welcome to change it into a feature request if your terminology reserves the word "bug" for more serious matters of data loss and catastrophe.
Comment 5 Manu Gupta 2014-05-08 17:32:59 UTC
Hello 

Vishesh asked me to look into this bug, as a junior job, 
I am able to reproduce it, I have a few questions

1. How do I debug by adding more logs and where can I take the logs, if possible while reproducing the issue or is there a better way issues in which issues are fixed by baloo developers
2. When I do a make install it overrides my systems baloo, I believe, is there a way to change it

I am very new here, so any help is appreciated.

Thanks  a lot
Manu
Comment 6 Manu Gupta 2014-06-02 18:24:52 UTC
Hello, 

I have root caused the issue, 

Issue is caused at :

        if (d->tagsSet) {
            QString tags = d->tags.join(",");
            kDebug()<<"Manu --> Setting Tags to "<<tags;
            setCustomFileMetaData(furl, QLatin1String("user.xdg.tags"), tags);
        }

in FileModifyJob::doStart()

Let me check further and update

Thanks
Manu
Comment 7 Felix Eisele 2014-07-22 22:30:20 UTC
Hello,
i am new in programming kde.So I find this little job. 
Sorry Manu Gupta i dont no if you already work on this bug/feature.

I created a codereview for this bug under https://git.reviewboard.kde.org/r/119415/
Comment 8 Vishesh Handa 2014-07-25 09:39:46 UTC
Git commit 3103a99316ef2e01a689d84022b624c8de51278a by Vishesh Handa, on behalf of Felix Eisele.
Committed on 25/07/2014 at 09:47.
Pushed by vhanda into branch 'KDE/4.14'.

Remove xattr instead of setting them to a blank string on deletion
REVIEW: 119415

M  +1    -1    src/file/lib/autotests/filemodifyjobtest.cpp
M  +21   -0    src/file/lib/baloo_xattr_p.h
M  +11   -1    src/file/lib/filecustommetadata.cpp

http://commits.kde.org/baloo/3103a99316ef2e01a689d84022b624c8de51278a