Skip to content

Commit 3a1c7e5

Browse files
committed
Revert "fix(sync): do not mistake own save requests for outside changes"
This reverts commit a4eeb24.
1 parent 6043569 commit 3a1c7e5

2 files changed

Lines changed: 1 addition & 161 deletions

File tree

lib/Service/DocumentService.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ public function getSteps(int $documentId, int $lastVersion): array {
307307

308308
/**
309309
* @throws DocumentSaveConflictException
310-
* @throws DoesNotExistException
311310
* @throws InvalidPathException
312311
* @throws NotFoundException
313312
*/
@@ -332,16 +331,7 @@ public function assertNoOutsideConflict(Document $document, File $file, bool $fo
332331
$fileChecksum = self::computeCheckSum($fileContent);
333332

334333
if ($storedChecksum !== $fileChecksum) {
335-
// $document was loaded at the start of the request.
336-
// A save request handled in the meantime is not reflected in it
337-
// and would be mistaken for an outside change.
338-
// Reload the document to compare against the latest saved state.
339-
$document = $this->documentMapper->find($documentId);
340-
if ($document->getChecksum() !== $fileChecksum) {
341-
throw new DocumentSaveConflictException('File changed in the meantime from outside');
342-
}
343-
// The save request already stored the latest version info.
344-
return;
334+
throw new DocumentSaveConflictException('File changed in the meantime from outside');
345335
}
346336

347337
$document->setLastSavedVersionTime($fileMtime);

tests/unit/Service/DocumentServiceTest.php

Lines changed: 0 additions & 150 deletions
This file was deleted.

0 commit comments

Comments
 (0)