diff --git a/Classes/Feature/WorkspaceCommandHandler.php b/Classes/Feature/WorkspaceCommandHandler.php index b499fbe..f9dae23 100644 --- a/Classes/Feature/WorkspaceCommandHandler.php +++ b/Classes/Feature/WorkspaceCommandHandler.php @@ -209,26 +209,6 @@ private function handlePublishWorkspace( $workspaceContentStreamVersion ); - yield from $this->publishWorkspace( - $workspace, - $baseWorkspace, - $baseWorkspaceContentStreamVersion, - $command->newContentStreamId, - $rebaseableCommands - ); - } - - /** - * Note that the workspaces content stream must be closed beforehand. - * It will be reopened here in case of error. - */ - private function publishWorkspace( - Workspace $workspace, - Workspace $baseWorkspace, - Version $baseWorkspaceContentStreamVersion, - ContentStreamId $newContentStreamId, - RebaseableCommands $rebaseableCommands - ): \Generator { $commandSimulator = $this->commandSimulatorFactory->createSimulatorForWorkspace($baseWorkspace->workspaceName); $commandSimulator->run( @@ -267,7 +247,7 @@ static function ($handle) use ($rebaseableCommands): void { } yield $this->forkContentStream( - $newContentStreamId, + $command->newContentStreamId, $baseWorkspace->currentContentStreamId, Version::fromInteger($baseWorkspaceContentStreamVersion->value + $eventsOfWorkspaceToPublish->count()) ); @@ -278,7 +258,7 @@ static function ($handle) use ($rebaseableCommands): void { new WorkspaceWasPublished( $workspace->workspaceName, $baseWorkspace->workspaceName, - $newContentStreamId, + $command->newContentStreamId, $workspace->currentContentStreamId, ) ), @@ -475,18 +455,6 @@ private function handlePublishIndividualNodesFromWorkspace( $workspaceContentStreamVersion ); - if ($remainingCommands->isEmpty()) { - // do a full publish, this is simpler for the projections to handle - yield from $this->publishWorkspace( - $workspace, - $baseWorkspace, - $baseWorkspaceContentStreamVersion, - $command->contentStreamIdForRemainingPart, - $matchingCommands - ); - return; - } - $commandSimulator = $this->commandSimulatorFactory->createSimulatorForWorkspace($baseWorkspace->workspaceName); $highestSequenceNumberForMatching = $commandSimulator->run(