Repository navigation
fix(dav): Return 423/403 for failed renames in the same folder - #67682
Open
kukanggg89 wants to merge 1 commit into
Open
kukanggg89 wants to merge 1 commit into
kukanggg89 wants to merge 1 commit into
Conversation
Node::setName() let LockedException, ForbiddenException and a refused rename escape as a 500, while Directory::moveInto() already converts the same failures to 423 and 403. Wrap the rename call the same way: a refused rename throws Forbidden, StorageNotAvailableException becomes ServiceUnavailable, ForbiddenException becomes Forbidden and LockedException becomes FileLocked. Adds five unit tests in NodeTest: one for each converted error plus a successful rename. Signed-off-by: parel <farelalfarizi89@gmail.com> Assisted-by: Muse:Muse Spark 1.3
kukanggg89
requested review from
Altahrim and
salmart-dev
and removed request for
a team
December 4, 2026 07:34
This branch has not been deployed
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.
Node::setName()does not convertLockedException,ForbiddenExceptionand a refused rename #67163Summary
A WebDAV MOVE that only renames a file in the same folder goes through
Node::setName(), which let every refusal escape as a 500: a locked file (LockedException), a mount point that cannot be moved (ForbiddenException), and a storage that refuses the rename (rename()returning false). The same MOVE to another folder goes throughDirectory::moveInto(), which already converts these to 423 and 403.setName()now does the same conversion: a refused rename throwsForbidden,StorageNotAvailableExceptionbecomesServiceUnavailable,ForbiddenExceptionbecomesForbidden, andLockedExceptionbecomesFileLocked. This follows the fix direction the maintainer confirmed in the issue.TODO
None.
Checklist
3. to review, feature: component) (n/a: maintainers set labels)stable32) (n/a: maintainers set the milestone)AI (if applicable)
Drafted with help from Claude. I reviewed and revised every change myself before opening this PR.
Verification
Five unit tests were added to
NodeTest: a locked file now throwsFileLocked(423), a refused rename throwsForbidden(403), aForbiddenExceptionfrom the storage throwsForbidden(403), aStorageNotAvailableExceptionthrowsServiceUnavailable(503), and a successful rename updates the node path. The test suite was not run locally (no PHP toolchain in this environment); CI runs it. Not validated on a live instance: the three cases from the issue were checked by code reading againstView::rename()andDirectory::moveInto(), not reproduced against a running server.