aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2025-04-04 13:41:32 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2025-04-04 13:41:32 +0200
commit3a09acebd23c0f59eeb3b08c358d6992029f609c (patch)
tree31acd4a7070b56dbb3d42a66a63efe973b614277
parenta35f4b16ac42ed73d7b540e40b72aaa160051f0f (diff)
downloadnextcloud-server-fix/require-update-if-mtime-is-null.tar.gz
nextcloud-server-fix/require-update-if-mtime-is-null.zip
fix(cache): always require updates if mtime is nullfix/require-update-if-mtime-is-null
- Resolves https://github.com/nextcloud/server/issues/51941 Due to strong typings we introduced the parameter needs to be an integer. Previously it was `null` which was equal to `0`. So if there is no storage mtime we need to update the cache. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
-rw-r--r--lib/private/Files/Cache/Watcher.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/Files/Cache/Watcher.php b/lib/private/Files/Cache/Watcher.php
index b6c69dd7330..f1de5d3cfb8 100644
--- a/lib/private/Files/Cache/Watcher.php
+++ b/lib/private/Files/Cache/Watcher.php
@@ -118,7 +118,7 @@ class Watcher implements IWatcher {
public function needsUpdate($path, $cachedData) {
if ($this->watchPolicy === self::CHECK_ALWAYS or ($this->watchPolicy === self::CHECK_ONCE and !in_array($path, $this->checkedPaths))) {
$this->checkedPaths[] = $path;
- return $this->storage->hasUpdated($path, $cachedData['storage_mtime']);
+ return $cachedData['storage_mtime'] === null || $this->storage->hasUpdated($path, $cachedData['storage_mtime']);
}
return false;
}