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

Improve dealing with deleted / renamed files #40

Open
runxel opened this issue Sep 16, 2024 · 11 comments
Open

Improve dealing with deleted / renamed files #40

runxel opened this issue Sep 16, 2024 · 11 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@runxel
Copy link

runxel commented Sep 16, 2024

If something gets renamed or removed (happens on network drives with colleagues all over it ;)) it would be nice to "recover" the latest path, or at least file name so you can then go and fix those missing documents by hand.

grafik

@runxel runxel added the enhancement New feature or request label Sep 16, 2024
@gingerbeardman
Copy link
Owner

Good idea.

I will look to display the file name at least.

@gingerbeardman gingerbeardman added this to the future milestone Sep 16, 2024
@runxel
Copy link
Author

runxel commented Sep 25, 2024

Another data point: Even without renaming Stapler has issues with files on a network share.
Could you look into this as well please? It looks like the screenshot above – even when the network share (locally run on a Synology NAS) is mounted and I can access the files just fine.

@gingerbeardman
Copy link
Owner

gingerbeardman commented Sep 25, 2024

Stapler just stores the aliases/bookmarks, they are created and processed by macOS.

They are not modified by Staplet after they've been added (hmm, maybe there should be?).

  1. Open Stapler document in a plain text editor
  2. Copy the bookmark encoded text for the file of your choice
  3. Unescape the text https://www.freeformatter.com/json-escape.html
  4. Paste the Base64 encoded text into Precize

If be interested if we can spot the difference between a file that gets "lost" and if we can maybe there's something I can do about it.

@runxel
Copy link
Author

runxel commented Sep 25, 2024

Okay it got even weirder. Now Stapler freezes on opening the stapler file – and so does Precize with the Base64 input!
Both do not recover and need to be killed...
Decoding the Base64 just "as-is" looks completely garbled, not sure if that is supposed to be like this:
grafik

Also from what I can see non-ASCII chars are dropped, like the German "ß" (sharp s).

@runxel
Copy link
Author

runxel commented Sep 25, 2024

I have another stapler also pointing to files on the same network share – that one works without a hitch. So it can't be the network share per se that is the issue.

@gingerbeardman
Copy link
Owner

gingerbeardman commented Sep 25, 2024

Sorry, I was brief before as I was on my iPhone @runxel

Make sure you are only decoding the content of the bookmark.

This is what I see when I working with one of my bookmarks:

Screen shot 2024-09-25 at 19 33 09

encoded

Ym9va7wCAAAAAAQQMAAAAHpF1pJqGLcWddHXLQvPkeOfGMmuf3ETMWg0pWwJoWO0uAEAAAQAAAADAwAAABgAKAUAAAABAQAAVXNlcnMAAAAEAAAAAQEAAG1hdHQJAAAAAQEAAERvY3VtZW50cwAAABAAAAABAQAAQWJvdXQgU3RhY2tzLnBkZhAAAAABBgAAEAAAACAAAAAsAAAAQAAAAAgAAAAEAwAAFmYAAAAAAAAIAAAABAMAAJTnBAAAAAAACAAAAAQDAAAzgQYAAAAAAAgAAAAEAwAAaIEGAAAAAAAQAAAAAQYAAHAAAACAAAAAkAAAAKAAAAAIAAAAAAQAAEGrrCMaAAAAGAAAAAECAAABAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAIAAAABAMAAAIAAAAAAAAABAAAAAMDAAD1AQAACAAAAAEJAABmaWxlOi8vLwwAAAABAQAATWFjaW50b3NoIEhECAAAAAQDAAAAkIKW5wAAAAgAAAAABAAAQcYvyAaAAAAkAAAAAQEAAEEyNjQwRDgyLTA0MjktNDhFQy04NTUyLUIyMDUyN0Q2ODE0NxgAAAABAgAAgQAAAAEAAADvEwAAAQAAAAAAAAAAAAAAAQAAAAEBAAAvAAAAAAAAAAEFAADMAAAA\/v\/\/\/wEAAAAAAAAAEAAAAAQQAABYAAAAAAAAAAUQAACwAAAAAAAAABAQAADYAAAAAAAAAEAQAADIAAAAAAAAAAIgAACkAQAAAAAAAAUgAAAUAQAAAAAAABAgAAAkAQAAAAAAABEgAABYAQAAAAAAABIgAAA4AQAAAAAAABMgAABIAQAAAAAAACAgAACEAQAAAAAAADAgAACwAQAAAAAAAAHAAAD4AAAAAAAAABHAAAAgAAAAAAAAABLAAAAIAQAAAAAAABDQAAAEAAAAAAAAAA==
image

decoded

Ym9va7wCAAAAAAQQMAAAAHpF1pJqGLcWddHXLQvPkeOfGMmuf3ETMWg0pWwJoWO0uAEAAAQAAAADAwAAABgAKAUAAAABAQAAVXNlcnMAAAAEAAAAAQEAAG1hdHQJAAAAAQEAAERvY3VtZW50cwAAABAAAAABAQAAQWJvdXQgU3RhY2tzLnBkZhAAAAABBgAAEAAAACAAAAAsAAAAQAAAAAgAAAAEAwAAFmYAAAAAAAAIAAAABAMAAJTnBAAAAAAACAAAAAQDAAAzgQYAAAAAAAgAAAAEAwAAaIEGAAAAAAAQAAAAAQYAAHAAAACAAAAAkAAAAKAAAAAIAAAAAAQAAEGrrCMaAAAAGAAAAAECAAABAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAIAAAABAMAAAIAAAAAAAAABAAAAAMDAAD1AQAACAAAAAEJAABmaWxlOi8vLwwAAAABAQAATWFjaW50b3NoIEhECAAAAAQDAAAAkIKW5wAAAAgAAAAABAAAQcYvyAaAAAAkAAAAAQEAAEEyNjQwRDgyLTA0MjktNDhFQy04NTUyLUIyMDUyN0Q2ODE0NxgAAAABAgAAgQAAAAEAAADvEwAAAQAAAAAAAAAAAAAAAQAAAAEBAAAvAAAAAAAAAAEFAADMAAAA/v///wEAAAAAAAAAEAAAAAQQAABYAAAAAAAAAAUQAACwAAAAAAAAABAQAADYAAAAAAAAAEAQAADIAAAAAAAAAAIgAACkAQAAAAAAAAUgAAAUAQAAAAAAABAgAAAkAQAAAAAAABEgAABYAQAAAAAAABIgAAA4AQAAAAAAABMgAABIAQAAAAAAACAgAACEAQAAAAAAADAgAACwAQAAAAAAAAHAAAD4AAAAAAAAABHAAAAgAAAAAAAAABLAAAAIAQAAAAAAABDQAAAEAAAAAAAAAA==
  • note that \/v\/\/\/ becomes /v/// etc

Paste and click Analyse

Screen shot 2024-09-25 at 19 32 33

@runxel
Copy link
Author

runxel commented Sep 26, 2024

Oh yeah, thank you for the detailed explanation. I figured it out already on the way 😄.
My comment still holds up. Precize and Stapler are choking on it.

@gingerbeardman
Copy link
Owner

I'm not really sure what you're trying to do?

If Precize does not process it, you've done something wrong.

Not sure what you mean about Stapler? You should not be modifying the Stapler file manually. I have not proposed you should make any changes there. How is it "choking".

If you want to share a working Stapler file with missing items I can look into it. Keep in mind it might have personal details in the path names.

Basically, I need much much more information to do anything about this one.

@runxel
Copy link
Author

runxel commented Sep 26, 2024

Sorry Matt if I wasn't precise enough.
What I meant was, that Stapler couldn't even open it's own .stapled file, but instead froze and not recover.
Then I tried to put in the decoded JSON part with the real content only, everything else stripped off, into Precize, which crashed on that input.
The screenshot above is just from a random Base64 decoder, beacuse I wanted to see if I can spot any issues like this. But then I saw that even from working stapler files the content "dumbly" decoded looks like garbled borf, so nothing to see there.

Today tho, after a restart, did 2 of 3 items recover and they are available again (= not "unknown"), also the stapler file itself opens again normally. It really is super mysterious.

@gingerbeardman
Copy link
Owner

gingerbeardman commented Sep 26, 2024

Very odd! Perhaps caching? No idea.

Stapler is a very thin wrapper on a bunch of system functions that I have no control over.

I will continue to look into this one, at least to show filename when the item cannot be found.

@runxel
Copy link
Author

runxel commented Sep 26, 2024

That's what I thought. It can not really be an issue in Stapler per se, if the content can got kaputt or be recovered at random.
I'll keep an eye on it – but I only had trouble with the NAS so far, which means it has something to do with how macOS accesses that. Probably not even much we can do here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants