Skip to content

Commit

Permalink
WIP drop-changes-during-publish-inside-tree-if-deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Feb 6, 2025
1 parent 6b9b267 commit 68b6c34
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function run(callable $fn): mixed
* We will automatically copy given commands to the workspace this simulation
* is running in to ensure consistency in the simulations constraint checks.
*/
private function handle(RebaseableCommand $rebaseableCommand): void
private function handle(RebaseableCommand $rebaseableCommand, bool $collectConflicts = true): void
{
// FIXME: Check if workspace already matches and skip this, e.g. $commandInWorkspace = $command->getWorkspaceName()->equals($this->workspaceNameToSimulateIn) ? $command : $command->createCopyForWorkspace($this->workspaceNameToSimulateIn);
// when https://github.com/neos/neos-development-collection/pull/5298 is merged
Expand All @@ -86,6 +86,9 @@ private function handle(RebaseableCommand $rebaseableCommand): void
try {
$eventsToPublish = $this->commandBus->handle($commandInWorkspace);
} catch (\Exception $exception) {
if ($collectConflicts === false) {
throw $exception;
}
$originalEvent = $this->eventNormalizer->denormalize($rebaseableCommand->originalEvent);

$this->conflictingEvents = $this->conflictingEvents->withAppended(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
use Neos\ContentRepository\Core\Feature\ContentStreamClosing\Event\ContentStreamWasReopened;
use Neos\ContentRepository\Core\Feature\ContentStreamCreation\Event\ContentStreamWasCreated;
use Neos\ContentRepository\Core\Feature\ContentStreamRemoval\Event\ContentStreamWasRemoved;
use Neos\ContentRepository\Core\Feature\NodeCreation\Command\CreateNodeAggregateWithNodeAndSerializedProperties;
use Neos\ContentRepository\Core\Feature\NodeModification\Command\SetNodeProperties;
use Neos\ContentRepository\Core\Feature\WorkspaceCreation\Command\CreateRootWorkspace;
use Neos\ContentRepository\Core\Feature\WorkspaceCreation\Command\CreateWorkspace;
use Neos\ContentRepository\Core\Feature\WorkspaceCreation\Event\RootWorkspaceWasCreated;
Expand Down Expand Up @@ -478,7 +480,13 @@ static function ($handle) use ($commandSimulator, $matchingCommands, $remainingC
}
$highestSequenceNumberForMatching = $commandSimulator->currentSequenceNumber();
foreach ($remainingCommands as $remainingCommand) {
$handle($remainingCommand);
try {
$handle($remainingCommand, collectConflicts: in_array(

Check failure on line 484 in Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 Test linting-unit-functionaltests-mysql (deps: highest)

Unknown parameter $collectConflicts in call to callable callable(Neos\ContentRepository\Core\Feature\RebaseableCommand): void.

Check failure on line 484 in Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 Test linting-unit-functionaltests-mysql (deps: highest)

Unknown parameter $collectConflicts in call to callable callable(Neos\ContentRepository\Core\Feature\RebaseableCommand): void.

Check failure on line 484 in Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 Test linting-unit-functionaltests-mysql (deps: highest)

Unknown parameter $collectConflicts in call to callable callable(Neos\ContentRepository\Core\Feature\RebaseableCommand): void.
$remainingCommand->originalCommand::class,
[CreateNodeAggregateWithNodeAndSerializedProperties::class, SetNodeProperties::class]
));
} catch (\Exception) {
}
}
return $highestSequenceNumberForMatching;
}
Expand Down

0 comments on commit 68b6c34

Please sign in to comment.