Description
Overview
The recycle bin is an optional feature used to temporarily and securely store deleted files. This feature is toggleable and could be recognized by SecureFolderFS through either:
- Checking if the recycle bin folder is present and contains items.
- Using a feature flag within the configuration file (e.g., "isRecyclebinPresent": true).
File Structure and GUID Naming:
The recycle bin is stored within the vault's content folder: content/recycle_bin.vi
. When a file or folder is deleted within a vault, it is moved to the recycle bin instead of permanently removed. The following rules govern how the contents are stored:
- root-level items in the recycle bin use a GUID-based naming scheme to ensure multiple deleted items can have the same (original) name,
- for each deleted item, a corresponding metadata file is created to store details such as its original name and location.
Example file structure
content/recycle_bin.vi
24bc6b96-71f7-4e81-b0cc-dddf6d6cbfa4 (deleted item - file or folder)
24bc6b96-71f7-4e81-b0cc-dddf6d6cbfa4.json (item metadata)
Example metadata structure
{
"originalPath": "/Documents/Work/File1.txt",
"deletionTimestamp": "2025-01-11T12:00:00Z"
}
Note
Depending on whether file name encryption is enabled, the originalPath
field may differ
Enabling/Disabling Recycle Bin
The recycle bin feature can be toggled from the app settings, with the following behavior:
-
Enabling the recycle bin
- The folder
content/recycle_bin.vi
is created if it does not already exist, - User authenticates the change to the configuration file and the flag "isRecyclebinPresent" is set to
true
, - Existing vault files are unaffected, and subsequent deletions will move items to the recycle bin.
- The folder
-
Disabling the recycle bin
- Contents already in the recycle bin remain intact,
- Deleting a file or folder bypasses the recycle bin and removes the item permanently,
- User authenticates the change to the configuration file and the flag "isRecyclebinPresent" is set to
false
- A visual hint is shown, indicating that the recycle bin is disabled
Accessing contents
Access to the recycle bin contents is managed entirely through the app interface. The app retrieves the list of deleted items by reading the metadata files stored within the recycle bin folder.
- The app enumerates all metadata files within the recycle bin and presents the user with the original file names, deletion timestamps, and original locations,
- The GUID-based file names and encrypted contents remain hidden from the user,
- Restoring an item renames it to its original name, and moves it back to its original location within the vault,
- If the destination directory no longer exists, user is prompted to choose a location through folder picker,
- The user may also choose to delete the item immediately by choosing the appropriate menu option
App Version
0.7.0.0 (WinUI), Microsoft Windows NT 10.0.22631.0