Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POC drop changes during publish inside deleted parts #5462

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
}
$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
Loading