Skip to content

Conversation

@sadiqkhoja
Copy link
Contributor

@sadiqkhoja sadiqkhoja commented Jan 19, 2026

Towards getodk/central#1337

Changes:

  • New API to delete the dataset
  • List datasets of a project API return only non-deleted datasets by default.
  • Added deleted query parameter to the List datasets of a project API that returns deleted datasets

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

All tests are passing

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

I had added a logic to check the dataset trash for duplicate dataset before creating a new one with the same name, but we discussed to remove that part because that would be noise or maybe that's exactly what users want to do.

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?

No

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

To be added to the feature branch.

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

@sadiqkhoja sadiqkhoja changed the title feature getodk/central#1337: Delete dataset Features: Delete dataset (WIP) Jan 19, 2026
@sadiqkhoja sadiqkhoja changed the base branch from master to features/delete-datasets-and-properties January 21, 2026 20:10
@sadiqkhoja sadiqkhoja force-pushed the features/delete-datasets branch from 3399c5a to d9fddda Compare January 22, 2026 17:32
@sadiqkhoja sadiqkhoja marked this pull request as ready for review January 22, 2026 19:23
@sadiqkhoja sadiqkhoja requested a review from ktuite January 22, 2026 19:23
@sadiqkhoja sadiqkhoja changed the title Features: Delete dataset (WIP) Features: Delete dataset Jan 23, 2026
});
}));

it('should not entities for deleted dataset', testService(async (service, container) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing word here, probably "create"?

Or it could say something like "should not create entities from a submission in a deleted dataset" to differentiate from just creating an entity via the API.

Suggested change
it('should not entities for deleted dataset', testService(async (service, container) => {
it('should not create entities for deleted dataset', testService(async (service, container) => {


await exhaust(container);

// TODO: assert that entity is not created.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could check the audit log on the submission to see that there was an entity.error event and no change to the expected number of entities in the dataset

// TODO: assert that entity is not created.
}));

it('should reject if there is a Form updating the dataset', testService(async (service) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be moved up near the test "should reject if there is a Form updating the dataset"

Suggested change
it('should reject if there is a Form updating the dataset', testService(async (service) => {
it('should reject if there is a Form consuming the dataset', testService(async (service) => {

@sadiqkhoja sadiqkhoja merged commit 2802ba5 into getodk:features/delete-datasets-and-properties Jan 26, 2026
6 checks passed
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.

2 participants