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

Force delete does not delete the file from the host dir #35

Closed
binuengoor opened this issue Jul 22, 2022 · 1 comment
Closed

Force delete does not delete the file from the host dir #35

binuengoor opened this issue Jul 22, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@binuengoor
Copy link

A pasta set to expire after say, 24 hours does get deleted from the UI as well as the underlying directory.
However if we force "Remove" from pasta list, then the file remains in the host directory. I am currently running a small script to clear them every 24 hours or so, but its not ideal.

When we select "Remove" from UI, it is being cleared from the database.json file. but it should also clear data from directory.

@szabodanika szabodanika added the bug Something isn't working label Jul 22, 2022
@szabodanika
Copy link
Owner

Thanks for reporting this @binuengoor, hopefully we can get this fixed soon. I am able to reproduce the same issue on the latest revision.

At a quick glance to me it seems like src/endpoints/remove.rs does not implement any file deletion, only updating the pasta model. The file src/util/misc.rs contains the remove_expired function called every time you interact with your MicroBin server and deletes the files for the pastas as well on expiration (in theory, I will need to re-test this). If we find that remove_expired works fine, we can simply update the pasta model and expire the selected pasta before the remove_expired call and that would instantly delete the attachment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants