fix: do not fail moves when the old location cannot be resolved#2784
Open
solracsf wants to merge 1 commit into
Open
fix: do not fail moves when the old location cannot be resolved#2784solracsf wants to merge 1 commit into
solracsf wants to merge 1 commit into
Conversation
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Member
Author
|
/backport to stable34 |
Member
Author
|
/backport to stable33 |
Member
Author
|
/backport to stable32 |
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.
Related: nextcloud/groupfolders#4548
This has been found by analyzing the stack traces in that issue.
When the pre-rename hook cannot resolve the old location of a move by file id (NotFoundException from
View::getPath(), e.g. on instances with inconsistent mount or file cache state),fileMove()aborted after setting$this->moveCasebut before collecting$this->oldAccessList.The post-rename hook then crashed with "
TypeError: array_keys(): Argument #1 ($array) must be of type array, null given" infileMoving(). SinceOC_Hook::emit()only catches Exceptions, the TypeError failed the whole WebDAV MOVE request after the files had already been moved, leaving clients out of sync with the server.Collect the state in
fileMove()under a NotFoundException guard that disables the post hook handling instead, and bail out offileMoving()if the old access list was never collected.Actually, this results in things like files being moved correctly on disk, but not on
oc_filecache, and only a manual scan will fix it.🤖 AI (if applicable)