Skip to content

Importing files with identical names silently fails (and can result in data loss) #396

@leleogere

Description

@leleogere

Currently, importing a new file into a folder with an existing file with an identical filename trigger a pop-up asks whether the user whether they want to overwrite it, which is expected.

However, when importing multiple files with identical filename at the same time via multiselect in the android file browser, then no dialog is displayed, and DroidFS only import one of them (likely the last one it sees as I suppose file paths are passed as a list to the app, which overwrite previous imports with same filename).

Most of the time, it should not happen as the android filebrowser only allow multiselecting files in the same folder, meaning that you can't really have multiple files with the same filename. However, it has a special tab "Recent", showing all recent files in the phone, no matter their folder, which allow the user to potentially select files with an identical filename, but in different folders. For example, some image editing apps export the edited picture in their own folder, with the same name as the original. Then importing in DroidFS both the original and the edited version from the "Recent" tab will only import a single one.

The main issue comes from the dialog at the end of the import asking if the user wants to wipe the original files. If you choose yes, and you had files with duplicate names, then duplicates are definitely lost as DroidFS did not import them, and still delete them from the system. I've lost a couple of pictures like that before understanding the issue.

Note that the issue also arise when sharing to DroidFS from an third party app, thus allowing files with different filenames to be passed at the same time. Only a single version of them will be imported. However, as there is no wipe dialog in that case the issue is slightly less problematic (but should still be addressed as the user might as well delete files from the system themselves, thinking that those files were correctly imported).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions