Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add test for updating etag with unchanged mtime
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 authored and artonge committed Feb 29, 2024
commit d1c7a0a9b0d028911b5a2a121459f4b2e54e2e2e
19 changes: 19 additions & 0 deletions tests/lib/Files/Cache/ScannerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,4 +404,23 @@ public function dataTestIsPartialFile() {
['/sub/folder/foo.txt', false],
];
}

public function testNoETagUnscannedFolder() {
$this->fillTestFolders();

$this->scanner->scan('');

$oldFolderEntry = $this->cache->get('folder');
// create a new file in a folder by keeping the mtime unchanged, but mark the folder as unscanned
$this->storage->file_put_contents('folder/new.txt', 'foo');
$this->storage->touch('folder', $oldFolderEntry->getMTime());
$this->cache->update($oldFolderEntry->getId(), ['size' => -1]);

$this->scanner->scan('');

$this->cache->inCache('folder/new.txt');

$newFolderEntry = $this->cache->get('folder');
$this->assertNotEquals($newFolderEntry->getEtag(), $oldFolderEntry->getEtag());
}
}