🐾 fix(api): cascade collection and item deletes too #10
Reference in New Issue
Block a user
Delete Branch "fix/collection-item-cascade"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Completes the cascade work from #9 (which was merged while this commit was in flight — this is the collection/item half, rebased onto the merged main).
What
Collection and Item DELETE — the REST endpoints and the HTML views — called bare
.delete(), leaking each collection's Items and every item's Chunks/Images/ImageEmbeddings:delete_collection_cascade(col)anddelete_item_cascade(item_uid)in the sharedlibrary_deleteservice, mirroring the library cascade's staged Cypher and returningitem_s3_keys/s3_keyfor future async S3 cleanup.DELETE /library/api/collections/{uid}/,DELETE /library/api/items/{uid}/, and the HTMLcollection_delete/item_deleteviews. Each logs what was removed.tasks._delete_item_and_chunksnow delegates todelete_item_cascadeinstead of duplicating its Cypher (same query, one home).Testing
30 tests green across
test_library_api(new: collection + item cascade called, 404 skips cascade),test_managed_by,test_tasks— the only error is the pre-existingtest_embed_item_failure(fails identically on clean main). Fulllibrary+mcp_serversuite matches the known baseline (8F/1E). Live Cypher on the manual e2e checklist per repo policy.🤖 Generated with Claude Code