Repository navigation
Delete the full ownership closure when deleting items - #17873
Merged
Merged
Conversation
Contributor
Jellyfin API (v 12.0.0)ResultNo differences. Specifications are equivalent |
crobibero
approved these changes
Sep 8, 2026
IDisposable
reviewed
Sep 11, 2026
|
IDisposable
approved these changes
Sep 12, 2026
joshuaboniface
pushed a commit
that referenced
this pull request
Sep 15, 2026
Delete the full ownership closure when deleting items Original-merge: 705b69e Merged-by: crobibero <cody@robibe.ro> Backported-by: Cody Robibero <cody@robibe.ro>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
FK_BaseItems_BaseItems_OwnerIdisNO ACTION, so every item owned by something being deleted has to go in the same statement or SQLite rejects the whole delete with error 19.DeleteItem expanded
OwnerIdonce, over a snapshot of the id set taken before the extras it found were added, so an extra owning an extra of its own was left pointing at a deleted row.FK_BaseItems_BaseItems_ParentIdisON DELETE CASCADE, so a child the AncestorIds closure did not list is removed by the database anyway, and anything it owned dangled the same way.Changes
Expand both edges to a fixpoint instead, feeding the next only from ids that were not already known so ownership cycles terminate.
Code assistance
Claude Opus 5 for tracing on a real DB clone and writing the test.
Issues
Fixes #17870