Repository navigation
Unhiding a file named "..." deletes the file and its content #517
Description
Checklist
- I can reproduce the bug with the latest version given here.
- I made sure that there are no existing issues - open or closed - to which I could contribute my information.
- I made sure that there are no existing discussions - open or closed - to which I could contribute my information.
- I have read the FAQs inside the app (Menu -> About -> FAQs) and my problem isn't listed.
- I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
- This issue contains only one bug.
- I have read and understood the contribution guidelines.
Affected app version
1.6.3
Affected Android/Custom ROM version
android 16
Affected device model
xiaomi 17
How did you install the app?
F-Droid / IzzyOnDroid
Steps to reproduce the bug
- ⋮ → Temporarily show hidden.
- In a folder, tap + → File → name it
...→ OK. The name is accepted. - Long-press
...→ ⋮ → Open as → Text file → File Manager. Type some text and save. - Long-press
...→ ⋮ → Unhide.
Expected behavior
The file is kept. Unhide either refuses the name or keeps the file under a valid name.
Actual behavior
A toast "Error: java.lang.IllegalArgumentException: All requested items must be referenced by specific ID" is shown, and the file is gone together with its content. Nothing is left in the folder under any name.
Screenshots/Screen recordings
| Before Unhide | After Unhide |
|---|---|
![]() |
![]() |
... (18 B) is selected. |
The error toast, and ... is gone. |
Additional information
Unhide removes only the first character of the name, so ... becomes ..:
File-Manager/app/src/main/kotlin/org/fossify/filemanager/extensions/Activity.kt
Lines 65 to 85 in 7f074fe
| fun BaseSimpleActivity.toggleItemVisibility(oldPath: String, hide: Boolean, callback: ((newPath: String) -> Unit)? = null) { | |
| val path = oldPath.getParentPath() | |
| var filename = oldPath.getFilenameFromPath() | |
| if ((hide && filename.startsWith('.')) || (!hide && !filename.startsWith('.'))) { | |
| callback?.invoke(oldPath) | |
| return | |
| } | |
| filename = if (hide) { | |
| ".${filename.trimStart('.')}" | |
| } else { | |
| filename.substring(1, filename.length) | |
| } | |
| val newPath = "$path/$filename" | |
| if (oldPath != newPath) { | |
| renameFile(oldPath, newPath, false) { success, useAndroid30Way -> | |
| callback?.invoke(newPath) | |
| } | |
| } | |
| } |
The rename then goes through Commons renameFile → renameCasually, which first moves the file onto a temporary file and then renames the temporary file to the target. Renaming it to <folder>/.. fails, and the failure branch deletes the temporary file, which by then holds the only copy of the data:
https://github.com/FossifyOrg/Commons/blob/675cd53384c9d1c09a8f7308dacb81757599ef50/commons/src/main/kotlin/org/fossify/commons/extensions/Activity.kt#L1142-L1172
Possible fix: in toggleItemVisibility, do not rename when the new name would be empty, . or ... Renaming the temporary file back to the old path on the failure branch (instead of deleting it) would also protect other failed renames.


Activity