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

Safe deletion of items #347

Closed
eikek opened this issue Oct 19, 2020 · 4 comments · Fixed by #1006
Closed

Safe deletion of items #347

eikek opened this issue Oct 19, 2020 · 4 comments · Fixed by #1006
Labels
joex affects the joex component restserver Affects the rest server.

Comments

@eikek
Copy link
Owner

eikek commented Oct 19, 2020

Currently deleting an item immediately removes it from the database.

Other approach: add a new state deleted and create a periodic job that really remove those items. Deletion for the user is then super fast and it can be "undeleted" for some period of time.

@maspiter
Copy link

Nice, but how to delete an item? I see how to remove documents from an item but no option to remove an item itself.

@eikek
Copy link
Owner Author

eikek commented Oct 23, 2020

You need to go to the detail of an item and then click on "edit" to open the menu where you can set tags etc. On the top right of that menu, there is a delete button (in red). Its on this screenshot: https://docspell.org/docs/webapp/curate/#modify-if-necessary

@maspiter
Copy link

Okay, got it. Thanks. That's a bit hidden but essential functionality.

@eikek
Copy link
Owner Author

eikek commented Oct 23, 2020

Ok, where would you put it? I think the edit menu is not a bad place; deleting items is probably rarely used, no? So my thoughts were to save the more prominent space for more often used things. But I might simply miss other use-cases. If you think this is important, could you open another issue for this? Thanks! (discussion and tracking; as this is already another one ;-))

@eikek eikek added joex affects the joex component restserver Affects the rest server. labels Jan 22, 2021
@eikek eikek added this to the Docspell 0.26.0 milestone Aug 6, 2021
@mergify mergify bot closed this as completed in #1006 Aug 14, 2021
eikek added a commit that referenced this issue Aug 15, 2021
In order to keep deleted items for a while, the periodic task can now
use a duration to only remove items with a certain age. This can be
used to ensure that a deleted item stays at least X days before it
will be removed from the database.

Refs: #347
eikek added a commit that referenced this issue Aug 15, 2021
In order to keep deleted items for a while, the periodic task can now
use a duration to only remove items with a certain age. This can be
used to ensure that a deleted item stays at least X days before it
will be removed from the database.

Refs: #347
eikek added a commit that referenced this issue Aug 15, 2021
First, when checking for existence of a file, deleted items are not
conisdered.

The working with fulltext search has been changed: deleted items are
removed from fulltext index and are re-added when they are restored.
The fulltext index currently doesn't hold the item state and it would
mean much more work to introduce it into the index (or, worse, to
reprocess the results from the index). Thus, deleted items can only be
searched using database queries. It is probably a very rare use case
when fulltext search should be applied to deleted items. They have
been deleted for a reason and the most likely case is that they are
simply removed.

Refs: #347
eikek added a commit that referenced this issue Aug 19, 2021
It was wrongly stored using RPeriodicTask directly, but the higher
level `UserTask` must be used instead, because this ensures a
correctly scoped periodic task using the `updateOneTask` method. Since
this is a system task, it can be given a fixed ID which makes it now
safe even if stored using RPeriodicTask directly.

The bug resulted in multiple empty-trash tasks to be inserted (on each
restart).

Refs: #347
eikek added a commit that referenced this issue Aug 19, 2021
It was wrongly stored using RPeriodicTask directly, but the higher
level `UserTask` must be used instead, because this ensures a
correctly scoped periodic task using the `updateOneTask` method. Since
this is a system task, it can be given a fixed ID which makes it now
safe even if stored using RPeriodicTask directly.

The bug resulted in multiple empty-trash tasks to be inserted (on each
restart).

Refs: #347
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
joex affects the joex component restserver Affects the rest server.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants