Skip to content

Conversation

@ktuite
Copy link
Member

@ktuite ktuite commented Jan 16, 2026

Part of getodk/central#1337

As a first pass, soft-delete the Entity List so any (non-deleted) Entities contained within it are still retrievable from the DB but don't show anything in the UI. There will be an endpoint to retrieve a CSV of the Entities that were in the Entity List at the time it was deleted. Entities deleted before the Entity List was deleted will not be included in the CSV.

This PR adds a new endpoint: GET projects/:id/datasets/deleted/:datasetId/entities.csv
Which returns csv of data, e.g. "people-deleted.csv"

Once datasets are deleted, their names can be reused, so the way to unambiguously reference an old dataset is by numeric ID. This is similar to restoring deleted forms.

What has been done to verify that this works as intended?

Tests.

Why is this the best possible solution? Were any other approaches considered?

@sadiqkhoja and I talked about using dataset ID vs. actee for referencing deleted dataset. We are using the ID for now but could switch to actee ID if that made sense in the future.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

Lets users download a snapshot of their deleted entity list from the trash before it is purged.

Does this change require updates to the API documentation? If so, please update docs/api.yaml as part of this PR.

Yes, this needs API documentation.

Before submitting this PR, please make sure you have:

  • run make test and confirmed all checks still pass OR confirm CircleCI build passes
  • verified that any code from external sources are properly credited in comments or that everything is internally sourced

@ktuite ktuite force-pushed the ktuite/deleted_dataset_snapshot branch from fa17e30 to 53ad056 Compare January 26, 2026 22:18
@ktuite ktuite changed the base branch from master to features/delete-datasets-and-properties January 26, 2026 22:18
@ktuite ktuite changed the title (WIP) Allow deleted entity list to be retrieved Allow soft-deleted entity list to be retrieved Jan 26, 2026
@ktuite ktuite marked this pull request as ready for review January 26, 2026 22:29
@ktuite ktuite requested a review from sadiqkhoja January 26, 2026 22:29
@ktuite ktuite merged commit 798c250 into features/delete-datasets-and-properties Jan 28, 2026
10 checks passed
@ktuite ktuite deleted the ktuite/deleted_dataset_snapshot branch January 28, 2026 20:07
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

Successfully merging this pull request may close these issues.

3 participants