Skip to content

Commit ea406f1

Browse files
authored
Merge pull request #43929 from nextcloud/backport/43896/stable28
2 parents 94e8727 + 68fcbbd commit ea406f1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

apps/files_versions/lib/Listener/FileEventsListener.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,12 @@ public function post_write_hook(Node $node): void {
218218
}
219219

220220
if (
221-
($writeHookInfo['versionCreated'] || $writeHookInfo['previousNode']->getSize() === 0) &&
221+
$writeHookInfo['versionCreated'] &&
222222
$node->getMTime() !== $writeHookInfo['previousNode']->getMTime()
223223
) {
224224
// If a new version was created, insert a version in the DB for the current content.
225-
// Unless both versions have the same mtime.
225+
// If both versions have the same mtime, it means the latest version file simply got overrode,
226+
// so no need to create a new version.
226227
$this->created($node);
227228
} else {
228229
try {

0 commit comments

Comments
 (0)