diff --git a/lib/Service/DocumentService.php b/lib/Service/DocumentService.php index dbeb24fc14d..3cbac106701 100644 --- a/lib/Service/DocumentService.php +++ b/lib/Service/DocumentService.php @@ -228,8 +228,10 @@ public function addStep(Document $document, Session $session, array $steps, int } $newVersion = $this->insertSteps($document, $session, $stepsToInsert); } - // If there were any queries in the steps send the entire history - $getStepsSinceVersion = count($querySteps) > 0 ? 0 : $version; + // If there were any queries in the steps send all steps since last save. + $getStepsSinceVersion = count($querySteps) > 0 + ? $document->getLastSavedVersion() + : $version; $allSteps = $this->getSteps($documentId, $getStepsSinceVersion); $stepsToReturn = []; foreach ($allSteps as $step) {