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

Enhancement of the delete function #27

Open
MortezaBiabani opened this issue Jul 16, 2020 · 3 comments
Open

Enhancement of the delete function #27

MortezaBiabani opened this issue Jul 16, 2020 · 3 comments
Assignees

Comments

@MortezaBiabani
Copy link

Hi,

Suppose we delete a file in the file manager by mistake, how can we restore it? Do we need something like Recycle Bin?
Is it possible to embed a general delete function like Windows (restore function delete or shift+delete)?

Best,
Morteza

@andersevenrud
Copy link
Member

It's possible to implement a trash can, but that would be in osjs-client and osjs-server. Since the VFS supports arbitrary storage connections it would have to work in a special way:

  • Custom virtual mountpoint that has a database of deleted files
  • Remving a file will place the path into the database, and the file gets renamed to something special (ex pattern: README.__trash__.md)
  • Files with this pattern is hidden from readdir results

Restoration would just be the opposite of this.

@MortezaBiabani
Copy link
Author

These steps you mentioned are operational.

It seems better to put a database for this in OS.js. It also matters where the database is located. Next, when we were dealing with larger data, backup, and data recovery seemed to be the next challenge.

Where has the deleted file in OS.js been so far? Could we access them with other apps? If this were to be done, could we consider it a bug?

What do you think of the idea of using MySQL (npm i mysql) in writing adapters? What is your proposed architecture? You do not want to add a package to the OS.js for trash?

best,
Morteza

@andersevenrud
Copy link
Member

Where has the deleted file in OS.js been so far?

Once deleted, it's gone. The VFS uses by default the host filesystem -- so it depends on that.

What do you think of the idea of using MySQL (npm i mysql) in writing adapters?

There's already a database settings adapter that supports mysql.

@andersevenrud andersevenrud self-assigned this Dec 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants