stash
stash copied to clipboard
[Bug Report] Long filenames cause cryptic deletion errors
Describe the bug My filesystem (zfs) has filename length limits of 255 bytes. While all the files in my library fall within these limits, I did not realize that stash requires renaming files to add the ".delete" suffix before deletion, leading to many files with names between 248 and 255 bytes that cannot be deleted through stash, that only yield a cryptic "file name too long" error. This error is unhelpful, as I knew according to my filesystem that my files did not have names that were too long.
Relevant code is here: https://github.com/stashapp/stash/blob/fc7c3f588e7cff56527a4d5faf55ec6c184df2bb/pkg/file/delete.go#L131
Expected behavior Stash should not assume that it can always safely add a suffix to a filename, or otherwise should have another option for safe deletion.
Screenshots If applicable, add screenshots to help explain your problem please ensure that your screenshots are SFW or at least appropriately censored.
Stash Version: (from Settings -> About): v0.20.1-3-ge685f80e
Desktop (please complete the following information):
- OS: macOS
- Browser: Chrome
- Version: 112.0.5615.49
There's a couple of ways to improve this. The error message in this case obviously needs improving. I can shorten the delete suffix to a single character like ~
, so that users are less likely to hit the limit. In that case, it would be a known limitation that the maximum length of a filename would be 254 bytes. Anything more holistic will require more effort than I think is worth this issue. I can't see too many users hitting this limitation.