Skip to content
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

[Feature] Recycle bin spec #82

Open
d2dyno1 opened this issue Jan 19, 2025 · 0 comments
Open

[Feature] Recycle bin spec #82

d2dyno1 opened this issue Jan 19, 2025 · 0 comments
Labels
feature request Request for adding a feature triage approved The issue has been reviewed and approved for development

Comments

@d2dyno1
Copy link
Member

d2dyno1 commented Jan 19, 2025

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:

  1. 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.
  2. 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

@d2dyno1 d2dyno1 added the feature request Request for adding a feature label Jan 19, 2025
@github-actions github-actions bot added the triage pending Indicates that the issue is awaiting approval label Jan 19, 2025
@d2dyno1 d2dyno1 added triage approved The issue has been reviewed and approved for development and removed triage pending Indicates that the issue is awaiting approval labels Jan 19, 2025
@d2dyno1 d2dyno1 pinned this issue Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request for adding a feature triage approved The issue has been reviewed and approved for development
Projects
None yet
Development

No branches or pull requests

1 participant