Skip to content

Commit 8c7bd01

Browse files
committed
fix: don't propagate future mtimes
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent 6230849 commit 8c7bd01

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

lib/private/Files/Cache/Propagator.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
use OCP\Files\Cache\IPropagator;
1414
use OCP\Files\Storage\IReliableEtagStorage;
1515
use OCP\IDBConnection;
16+
use OCP\Server;
17+
use Psr\Clock\ClockInterface;
1618
use Psr\Log\LoggerInterface;
1719

1820
/**
@@ -39,10 +41,13 @@ class Propagator implements IPropagator {
3941
*/
4042
private $ignore = [];
4143

44+
private ClockInterface $clock;
45+
4246
public function __construct(\OC\Files\Storage\Storage $storage, IDBConnection $connection, array $ignore = []) {
4347
$this->storage = $storage;
4448
$this->connection = $connection;
4549
$this->ignore = $ignore;
50+
$this->clock = Server::get(ClockInterface::class);
4651
}
4752

4853
/**
@@ -58,7 +63,9 @@ public function propagateChange($internalPath, $time, $sizeDifference = 0) {
5863
}
5964
}
6065

61-
$storageId = (int)$this->storage->getStorageCache()->getNumericId();
66+
$time = min($time, $this->clock->now()->getTimestamp());
67+
68+
$storageId = $this->storage->getStorageCache()->getNumericId();
6269

6370
$parents = $this->getParents($internalPath);
6471

0 commit comments

Comments
 (0)