droppyjs / droppy

Self-hosted file storage
BSD 2-Clause "Simplified" License
104 stars 12 forks source link

Renaming a folder over existing other folder is broken #74

Open Tronic opened 1 year ago

Tronic commented 1 year ago

Given folder A and B, if the user renames A to B, afterwards Droppy only displays folder B with the prior content of A. However, on the filesystem nothing happens, A and B still contain their original files. Trying to access the files via Droppy gives 404 errors.

Renaming should check for success of the actual disk operation (that the name didn't exist), and only update Droppy's internal database if so.

vahtos commented 5 months ago

Note that naming conflicts for files are prevented in the UI. Ideally, in both cases Droppy would provide a prompt to change the name (similar to how many desktop file explorer apps work). A simpler fix would be to implement the same behavior for folders that is used for files currently.

vahtos commented 5 months ago

Renaming a file to the name of a folder is permitted in the client, but causes an error on the server: [ERROR] EISDIR: illegal operation on a directory, rename '/home/vahtos/.droppy/files/whereami' -> '/home/vahtos/.droppy/files/New folder'

Couple of notes about this:

vahtos commented 5 months ago

I am at a loss here. In the middle of debugging this, I can no longer reproduce any of it. I've made no changes, I restarted droppy, I tried reverting to previous commits (before v1.0.1), I deleted the cache, I tried a different browser. I even tried an entirely different instance of droppy, running (v1.0.1) on a different machine.

@markhughes can you reproduce this?