Fix wrong condition so unreadable files won't be in the filecache #40480
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
Files without read permission won't be in the filecache. A files:scan is also expected to remove the files without read permission (as long as the scanning goes through the target file).
This is also expected to affect the clients because the target file won't be in the propfind response any longer.
Related Issue
#40460
Motivation and Context
Need to check if this is the right behavior. Up until now, permissions were stored in the filecache even if the file was unreadable. This has led to files with write permissions but not read permissions in the fliecache. This seems to be wrong accordingly to the modified condition.
Note that file metadata such as comments and tags will be either removed or disconnected because the file will be removed. If the file regains the read permission at a later point, it will be considered a new file with a new fileid.
This PR might cause side-effects.
How Has This Been Tested?
The file is removed from the filecache table.
There are several cases not tested yet, specially with external storages.
Screenshots (if appropriate):
Types of changes
Checklist:
Notes
@pmaier1 I think we need to decide which is the right behavior.