Skip to content
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

[6.x] Resolve issues with silent Artisan failures & FileStore cache flushing #33458

Merged
merged 1 commit into from
Jul 7, 2020

Conversation

mallardduck
Copy link
Contributor

This PR has been created in response to #33310 and seeks to resolve that issue and an issue previously discussed as #1179. As well as being a follow up to PR #25254 - to more fully catch the issues that PR attempted to address.

The only flaw (for lack of better term) with the previous PR was that the underlying FileStore::flush() method wasn't reliably returning false as the result response. This is in turn due to how Filesystem::deleteDirectory() works, since this method simply silently fails if there are issues with removal.

Since Filesystem is such a fundamental component and changing deleteDirectory that much would surely break tests and be a BC issue. So solving the issue in the FileStore class seems like a good option, since we can be 'defensive' about the results of deleteDirectory.

While a more elegant solution may exists - and could be a long term goal - this addresses the new reported issue (#33310) and provides a more robust method to enable the previous fix (#25254) to work as intended.

This change subtly adjusts how directory deletions are confirmed. The main change being that we're reactively confirming if the directory was deleted.

The original code assumes that the deleteDirectory method is always going to return false when it fails. This is an incorrect assumption to make.
Because the deleteDirectory method actually will only return false if the input path isn't a directory. And it will silently fail if it has issues with removal of the directory and/or it's children items.
@taylorotwell taylorotwell merged commit 8056b41 into laravel:6.x Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants