Skip to content

Conversation

@bolinocroustibat
Copy link
Contributor

@bolinocroustibat bolinocroustibat commented Sep 16, 2025

Related to issue datagouv/data.gouv.fr#1862.
Needs datagouv/hydra#340 to be merged first.

@bolinocroustibat bolinocroustibat changed the title 410 on resource deleted feat: HTTP response 410 on deleted resource Sep 16, 2025
@bolinocroustibat bolinocroustibat self-assigned this Sep 16, 2025
@bolinocroustibat bolinocroustibat marked this pull request as draft September 16, 2025 10:49
@bolinocroustibat bolinocroustibat marked this pull request as ready for review September 16, 2025 12:07
@bolinocroustibat bolinocroustibat force-pushed the 410-on-resource-deleted branch 2 times, most recently from 24b4c8c to d029532 Compare September 16, 2025 17:06
Copy link
Contributor

@maudetes maudetes left a comment

Choose a reason for hiding this comment

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

Thank you, looks clean!

if record[0].get("deleted_at") is not None:
deleted_at: str = record[0]["deleted_at"]
raise web.HTTPGone(
text=f"Resource {resource_id} has been permanently deleted on {deleted_at} by its producer. Contact the resource producer to get more information."
Copy link
Contributor

Choose a reason for hiding this comment

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

We could point towards the dataset maybe, for an incentive to create a discussion there?
The dataset may have been deleted as well though, leading to a 410 first and then a 404 when it has been finally purged.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Totally, this is the plan, but since it's not in the same database it needs a migration to have this info in table_index, and more DB requests on hydra's side. As it is a bit trickier, it is currently being be considered in separate PRs.

@bolinocroustibat bolinocroustibat merged commit df176c7 into main Sep 30, 2025
4 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.

3 participants