Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single named colored tag gets restored as named colored tag + generic tag with color name #56

Open
porg opened this issue Jul 13, 2022 · 10 comments
Labels
bug Something isn't working

Comments

@porg
Copy link

porg commented Jul 13, 2022

Reproduction

  1. At ~/path/ file 2.txt has a tag "•Done" in red color
  2. osxmetadata --backup ~/path/*
  3. Removing Finder tags and comments from all files in the test directory.
  4. osxmetadata --restore ~/path/*
  • Expected: File 2.txt with tag "•Done" in red color
  • Actual: File 2.txt with tag "•Done" in red color + generic tag "Red" in red color

Environment

  • osxmetadata 0.99.37 (installed via pipx, which itself got installed via brew)
  • macOS 11.6.6
  • Same bug occurs on a local APFS and on a SMB mounted Share from a linux NAS
@RhetTbull
Copy link
Owner

I just tried to reproduce this and was not able to. In my case, the .Done tag was re-created with the color but the generic color tag was not added. I'm running 10.15.7 though. I'll take a look and see if I can figure out what's going on.

@RhetTbull RhetTbull added the bug Something isn't working label Jul 14, 2022
@porg
Copy link
Author

porg commented Jul 16, 2022

Ok and thanks for looking into this.

@RhetTbull
Copy link
Owner

This last two commits were really for #57 -- still working on reproducing this one.

@RhetTbull
Copy link
Owner

@all-contributors please add @porg for bugs, ideas

@allcontributors
Copy link
Contributor

@RhetTbull

I've put up a pull request to add @porg! 🎉

@jkscx
Copy link

jkscx commented Apr 16, 2023

@porg, idk if it helps, but I had a similar issue while manually adding/removing Finder tags via a python script. In my case the issue was that I had a stale "com.apple.FinderInfo" xattr which stored the color info in addition to the regular Finder tag ("com.apple.metadata:_kMDItemUserTags" xattr). So when I removed the Finder tag (which had color) I got the standalone/generic color tag (from "com.apple.FinderInfo"). Removing the stale "com.apple.FinderInfo" xattr solved the issue in my case.

@porg
Copy link
Author

porg commented Apr 16, 2023

@jkscx Not yet conducted any practical tests but from theory it sounds very plausible that the storage of the very same attribute at different metadata positions which needs syncing at each transaction can result in out of sync states if something is done improperly.

@jkscx
Copy link

jkscx commented Apr 17, 2023

Btw, a simple GUI tool which helped me inspect the xattrs of the file and find the issue in my setup is xattred from the macOS guru eclecticlight, in case you're interested. Simpler than viewing the xattrs via the command line and automatically decodes the binary plist of the Finder tags xattr.

@porg
Copy link
Author

porg commented Apr 19, 2023

Still the bug as in the description above is valid.

  • Whether the cause is on osxmetadata or upstream (python, file system, macOS) I dunno.
  • We leave that open. Should I get a newer Mac/macOS, I will try again and report.

@RhetTbull
Copy link
Owner

@porg thanks for the update. I just tried to replicate this using your steps with macOS 13.1 and python 3.11.2 but could not replicate it. Will keep open as you're still seeing it. I did find another bug in the backup code while testing this that could cause backups to be corrupted on Ventura so I recommend upgrading to 1.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants