From 3a09acebd23c0f59eeb3b08c358d6992029f609c Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Fri, 4 Apr 2025 13:41:32 +0200 Subject: fix(cache): always require updates 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 --- lib/private/Files/Cache/Watcher.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v1.2.3