-
Notifications
You must be signed in to change notification settings - Fork 162
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
Add remaining functionality for entity deletion #710
Comments
I'm realizing that this isn't totally accurate. It looks like it is possible to list deleted entities via the REST API (…/entities?deleted=true). However, we also need to be able to list deleted entities via OData. I'll update the issue description to make this distinction. One thing to note is that unlike entities, it isn't possible to list deleted submissions via the REST API. It's only possible via OData. I don't think we need to add support for that, but I wanted to note that that will be one piece of asymmetry between submission deletion and entity deletion. |
@getodk/testers this issue is ready for testing. |
@sadiqkhoja @matthew-white |
Following changes are done on the UI:
Backend:
If you tested undelete(restore) API and changes related to delete in Odata feed for Submission then I would suggest to test them for Entities as well. |
I have one case where I need to make sure. I have project on Central and I scanned it on Collect. And now I'm thinking of all the cases where someone may have an old form state with an entity, will have the automatic download of a new version of the form disabled, and will be able to send a form with data that was deleted some time ago. Is there some solution for this or are you aware of that in this is fully expected? |
Last time we tested purge using CLI commands provided by Matt, could you send me ones for purging deleted entities? (can be on slack)
We didn't test API and OData feed |
For the case you described about deleted entity available on Collect, we are implementing #668 and corresponding change in Collect. Good catch about the missing purging instruction and red deletedAt column. I will fix it in a separate PR. I have sent you the CLI command on the slack. |
It is currently possible to delete an entity either via the API or from Frontend. However, we don't ever purge entities. There also isn't a way to list deleted entities via OData or to restore/undelete a deleted entity. Eventually, we want both entity deletion and submission deletion to match all the functionality we offer around form deletion. Here is the functionality as things stand with the release of v2024.2:
This issue is to complete what's remaining under the "Entity deletion" column. There are related release criteria here.
Any existing deleted entities in the database should be immediately purged. That is, they shouldn't show up anywhere in Frontend or linger for 30 days. I think we did something similar when we first rolled out form purging.
As a technical note, one thing we've talked about is the need to tombstone (keep a record of) purged entities. We do so for purged forms via the
actees
table. We don't tombstone purged submissions, but we can retrieve all the information we need for them from the audit log. One specific reason we've talked about tombstoning purged entities has to do with #668. Basically, we never want the same UUID to refer to two different entities, even if one has been purged. If that were possible, then we could have a scenario like this:To prevent this sort of case, when an entity is created, we should check that its UUID has never been used, even for a previously purged entity. Right now, the uniqueness constraint on the
entities
table does all that we need, but we'll probably need something more once we work on this issue.The text was updated successfully, but these errors were encountered: