Do not try to remove the same file twice#39070
Merged
jvillafanez merged 2 commits intomasterfrom Aug 10, 2021
Merged
Conversation
Contributor
|
💥 Acceptance tests pipeline apiSharePublicLink2-mariadb10.2-php7.4 failed. The build has been cancelled. |
Contributor
|
💥 Acceptance tests pipeline webUIComments-chrome-mariadb10.2-php7.4 failed. The build has been cancelled. |
8b132bd to
a7008dc
Compare
a7008dc to
6b5c258
Compare
|
Kudos, SonarCloud Quality Gate passed! |
JammingBen
approved these changes
Aug 6, 2021
Contributor
|
@phil-davis fyi |
Contributor
|
When CI is green, I am happy. |
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.








Description
Do not try to remove the file twice while moving it to the trashbin
Related Issue
#38923
Motivation and Context
While removing a file and moving it to the trashbin, the source file or folder was deleted twice. The second call was failing because the file was already removed in the first call. This problem was ignored in the storage (which would try to remove the file again without logging the failure) and in the trashbin (ignoring the related failure).
Since the
move2trashfunction already takes care of removing the source (for whatever reason) in case the move fails, we only need to take care of the deletion in case the trashbin isn't setup properly. In order to distinguish this case, themove2trashfunction will return null instead of the true. Trashbin storage is adjusted for this case.The overall behaviour remains compatible with the previous assumptions.
How Has This Been Tested?
Manually tested following steps described in #38923
Screenshots (if appropriate):
Types of changes
Checklist: