Ensure collection safety on /catalogs route #562
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related Issue(s):
Description:
This PR implements a "Safety-First" deletion policy for the Catalogs Extension. It fundamentally changes the behavior of
DELETEoperations to strictly separate Organization (Catalogs) from Content (Collections). Deleting a catalog now "disbands" the group but never destroys the underlying data, preventing accidental loss of large datasets.Key Changes:
1. Safety Architecture ("Unlink & Adopt")
DELETE /catalogs/{id}now removes the catalog container but strictly unlinks all child collections. If a collection becomes an orphan (no parents left), it is automatically adopted by the Root.DELETE /catalogs/{id}/collections/{id}now unlinks the collection from that specific catalog context only. It never deletes the collection data, even if it was the only parent.2. Removed Destructive Features
cascadeparameter: The?cascade=trueoption has been removed. It is no longer possible to trigger a recursive data delete via the catalogs route. Intentional data deletion must now be done via the core/collections/{id}endpoint.PR Checklist:
pre-commit run --all-files)make test)