Skip to content

Commit

Permalink
fix: Keep document table entry and only cleanup when we force it
Browse files Browse the repository at this point in the history
We want to keep the document table entry and the presence of a y.js state file in sync

Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Mar 13, 2024
1 parent 2b4fd02 commit 1e10b1a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Service/DocumentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,10 @@ public function resetDocument(int $documentId, bool $force = false): void {

$this->stepMapper->deleteBeforeVersion($documentId, $document->getLastSavedVersion());
$this->sessionMapper->deleteByDocumentId($documentId);
$this->documentMapper->delete($document);

if ($force) {
$this->stepMapper->deleteAll($documentId);
$this->documentMapper->delete($document);
$this->getStateFile($documentId)->delete();
}
$this->logger->debug('document reset for ' . $documentId);
Expand Down

0 comments on commit 1e10b1a

Please sign in to comment.