Repository navigation
Conversation
…back (#37782) A folder delete that fails partway rolls back its database rows but has already removed the binaries of the files it reached, so those files stay listed and return 404. The spec defers the disk removal until the transaction commits, and carries three smaller bulk delete fixes the bulk duplicate already has. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Claude finished @zJaaal's task in 1m 12s —— View job Spec review — #37782 folder-delete binariesThis PR adds only Code claims — all verified against the tree
The spec is accurate, well-scoped, and its blast-radius call-out (every content destroy, timing-only change, push-publishing receiver as the first caller to vet) is the right thing to flag for the plan. Worth the plan's attention (not spec defects — carry into
|
Collect what to remove at destroy time, run the removal synchronously after commit and isolate its failures, cover deleteVersion's metadata removal, state the carried-over covered-by-parent rules, correct the REST compatibility statement, and test each destroy path directly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… commit (#37782) Address the automated spec review: moveBinaryFilesToTrash already defers a binary removal with addCommitListener, and the hook fires on the outermost commit, which is what keeps every file when a folder delete is refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the review. All three observations checked against the code:
Written by Claude (Claude Code) on behalf of @zJaaal. |
Record that database-stored metadata is removed outside the transaction today, assert AC-003b on the removal's own error handling, require the plan to prove outermost-commit behaviour per destroy path, and assert AC-003 synchronously. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Second review addressed in 7342ddc:
Written by Claude (Claude Code) on behalf of @zJaaal. |
Make the removal's error handling cover metadata as well as files, and state that it needs no fixed position among other after-commit work. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Third review addressed in 3b49463:
Written by Claude (Claude Code) on behalf of @zJaaal. |
|
dotbot code review:
Docs-only addition of specs/37782-folder-delete-binaries/spec.md; no code, behavior, or API changes to break existing tests. Tip: comment with "/dotbot address comments" to attempt automated fixes for unresolved review threads. reviewed by dotbot · meta/muse-spark-1.3 · medium |
|
dotbot code review:
The change adds only a specification document; no code is modified. I verified the spec's key factual claims against the repository: Tip: comment with "/dotbot address comments" to attempt automated fixes for unresolved review threads. reviewed by dotbot · ~z-ai/glm-latest · medium |
dotCMS-Machine-User
left a comment
There was a problem hiding this comment.
✅ dotbot review: all reviewer models (meta/muse-spark-1.3, ~z-ai/glm-latest) agree — patch is correct.
approved automatically by dotbot
|
Fourth review: no spec changes; both items are carried into
Written by Claude (Claude Code) on behalf of @zJaaal. |
|
Approving the direction. One concern: the blast radius. The file removal moves into the shared content destroy ( |
Spec-Kit specification (PR 1 of 2) for fixing #37782. This PR carries
specs/37782-folder-delete-binaries/spec.mdonly; the implementation lands in a second PR stacked on this one once the spec is approved.The problem
When a folder delete fails partway through the folder's tree, the database rolls back but the files it already reached are gone from disk. The folder and every file still show in Content Drive, but the files the delete had reached return
404, and the author is only told the delete failed. Nothing can recover them.It happens with the context-menu delete and the bulk delete alike. A permission refusal on one subfolder is enough to trigger it, and so is content locked by another user deeper in the tree, or any database error after the first file is destroyed.
The fix the spec proposes
Remove files from disk only after the database commits.
ESContentletAPIImpl.deleteBinaryFiles), outside the transaction.HibernateUtil.addCommitListener). A delete that commits removes the files as today; a delete that rolls back leaves them in place.What does not change: folder delete still runs one transaction per top-level folder and stops a folder on the first refusal, and bulk delete still continues with the other selected folders. Paging the walk and the transaction decision stay in #37565.
Three smaller bulk delete fixes carried with it
The bulk folder duplicate already fixed each of these; bulk delete still has them.
500. It will answer400 EMPTY_SELECTION, as{}already does.Worth a reviewer's attention
specs/37063-bulk-folder-delete-backend/spec.md). Fix 1 replaces that with a run-time decision, the same amendment the bulk duplicate spec made in review on 2026-09-29. The amendment is recorded in this spec; the approved one is not edited.How it will be verified
Integration tests that fail on today's code first: the file is still on disk (and its metadata readable) after a refused or locked folder delete, and a rolled-back destroy keeps its files for each of the four destroy paths, tested directly on the content API. Guard tests that pass before and after: a successful delete and a content type delete still clear the disk, a non-transactional destroy still removes immediately, and a failing removal does not break the commit. One test per parent outcome for fix 1. Plus a unit test and a Postman request for the no-body case.
🤖 Generated with Claude Code