graasp / graasp/graasp-api

Some items can be added to the recycle bin but are not marked as deleted (soft-delete with `deleted_at` timestamp)

Open
#799 0 comments 0 reactions 1 assignee Assigned to @spaenleh View on GitHub
bug :beetle:
Dominant language
TypeScript
Stars
7
Forks
5
PR merge metrics
No merged PRs in 30d

Description

It looks like we are having some inconsistency issues with items that are requested to be put in the recycle bin by users but they are not marked as deleted, so users can still see them, but they can no recycle them as they get a "duplication key error" on the `recycled_item_data.item_path` column.

"Easy fix" would be to add the deleted_at timestamp to the item by copying the `created_at` timestamp from the recycled_item_data table. But this would remove items that users might have been willing to keep.

We should investigate if maybe we have some inconsistency issues in the recycling process or if the restoration does not delete items from the recycled_item_data table.

Use the following query to list items that are in the recycle_bin without being marked as deleted (this should be 0...):

```sql
select rec.id, i.id, i.name, rec.created_at, i.created_at, i.updated_at from recycled_item_data rec left join item i on i.path=rec.item_path where i.deleted_at is NULL;
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.