fix(workspace): Use filecache existance for checking if readme exists #6891
+7
−4
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.
Alternative to #5963
While i initially pushed this fix to the earlier PR i think it would be enough in its own without affecting mobile app behaviour. We save the most expensive step to check file existence on the actual remote storage by just using the file cache entry.
This improves the situation for any external storage as well as federated shares by saving 4 checks on the remote for file existence, only if we know a file we will access it to get the content.
This of course has one limitation, that the file needs to be known to Nextcloud already, but should be fine for most of the cases.
Todo from chat:
1738924269.607566 [0 unix:/var/run/redis/redis-server.sock] "GET" "8b16b520c496b13f920772e0b509487a/text_workspace175301_549b3998cd6b2f08d58c4033e85a084a"
1738924269.617739 [0 unix:/var/run/redis/redis-server.sock] "SETEX" "8b16b520c496b13f920772e0b509487a/text_workspace175301_549b3998cd6b2f08d58c4033e85a084a" "3600" """"
Turns out the file was empty, so the check at
text/lib/DAV/WorkspacePlugin.php
Lines 92 to 96 in 40e63bb
Might be a corner case, but guess filing an issue makes sense?