From e663f3409ec387d55b3c0cec7321b2bf1fa20f76 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Mon, 9 Dec 2024 19:21:46 +0100 Subject: [PATCH] TASK: Revert special code path from partial to full publish Reverts 05d6d5a1865466b06f5e1df62a014fcba61b1bd2 partially Initially this change was done to fix #5303 But that was a hoax see https://github.com/neos/neos-development-collection/issues/5303#issuecomment-2528984614 we always emit the `WorkspaceWasPublished` event and this just simplifies the code-path again. For the discard all case, the code is stil a little easier to read _with_ the condition. --- Classes/Feature/WorkspaceCommandHandler.php | 36 ++------------------- 1 file changed, 2 insertions(+), 34 deletions(-) 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(