-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor recursiveDelete #121
Conversation
The recursiveDelete method causes problems in certain environments with the RecursiveDirectoryIterator not iterating through all elements of a tree when deleting nodes while iterating. This is solved by first completing the iteration and only then deleting all elements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you apply the very same changes to the lib/Updater.php -
Lines 675 to 678 in 8b3d7d0
foreach ($iterator as $fileInfo) { | |
$action = $fileInfo->isDir() ? 'rmdir' : 'unlink'; | |
$action($fileInfo->getRealPath()); | |
} |
This is also check in the integration tests and they will then succeed, if the changes are the very same.
Beside that the change looks good. 👍
Thanks
Changes also applied to lib/Updater.php. Hope that makes it work. :) |
What is the reason this pull request got stuck? |
Ok, sending a dummy commit triggered the build pipeline again - the tests still failing ( |
A rebase helps here.
I had I open but then forgot to answer here, that a rebase would help to get this in. Let me do this and open a separate PR for this and get it merged. |
I rebased this and squashed all commits into one. Let's see what CI says to it: #132 |
Ah I see - rebasing would have done the trick. Sorry for not noticing that. Anyway, #132 seems to make CI happy, so I'll close this one. Thanks for your help @MorrisJobke |
Thanks for your contribution 👍 |
The recursiveDelete method causes problems in certain environments with the RecursiveDirectoryIterator not iterating through all elements of a tree when deleting nodes while iterating. See nextcloud/server#2737 for a more detailed discussion of the issue.
This is solved by first completing the iteration and only then deleting all elements (first the files, then the directories).