-
Notifications
You must be signed in to change notification settings - Fork 49
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
Web clipper overwrites existing database entries #623
Web clipper overwrites existing database entries #623
Comments
After a bunch of debugging I believe I've found the root cause in the way inode numbers are used to detect moved/renamed files:
Relatedly, any operation modifying file metadata with exiftool causes the file's inode number to change, breaking subsequent renames. If you change an image's metadata in Allusion and then rename the file, a new entry is created and the old one is still visible as a missing image. |
Fixes allusion-app#623 This fixes issues with the way renamed files are detected from inode numbers, which would become desynced whenever exiftool was used. Any files that had their metadata edited would not be correctly detected as moved, and the web clipper would occasionally overwrite existing database entries, mistaking them for moved files.
Fixes allusion-app#623 This fixes issues with the way renamed files are detected from inode numbers, which would become desynced whenever exiftool was used. Any files that had their metadata edited would not be correctly detected as moved, and the web clipper would occasionally overwrite existing database entries, mistaking them for moved files.
Turns out exiftool has a parameter that makes it write in place, which prevents files being moved. I've made a PR applying it in #624. The same issue can still be caused by replacing files manually, so it may be worth considering alternative solutions that don't involve inode numbers at all, but with this modification Allusion no longer breaks itself (in cases I've tested anyway). |
Describe the bug
Occasionally when adding an image with the web clipper add-on, it replaces an existing entry instead of creating a new one. The added image receives the tags and time of import of the old entry, which disappears from the gallery until Allusion is restarted, at which point it reappears as a newly imported entry with no tags. Any subsequent images added with the web clipper will all replace this same entry, and all tags added via the web clipper will appear on this entry. This behavior persists even across restarts.
I've also noticed that the next time a new image is added to the directory by saving it there without using the web clipper, it also replaces the same entry, but the next image after that will create a new entry. Edit: After some debugging it seems that files added with the clipper are interpreted as being moved/renamed when a new file is added after them. Continuing to investigate.
To Reproduce
Steps to reproduce the behavior:
Strangely, this only sometimes happens on my main Allusion collection, but on a development build with a newly created database it seems to happen every single time I use the web clipper. This also happens if I add an image by manually sending an http request to the clip server endpoint, so it's definitely an issue with the host process, not the browser extension.
Expected behavior
All added images receive new database entries and old ones are unchanged.
Allusion version
Desktop OS
The text was updated successfully, but these errors were encountered: