From 19cb5c2132468110f7670aae3e953ad175ac4652 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Thu, 9 Jan 2025 11:36:11 +0100 Subject: [PATCH] TASK: Inline condition into match call --- .../AssetUsage/CatchUpHook/AssetUsageCatchUpHook.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Neos.Neos/Classes/AssetUsage/CatchUpHook/AssetUsageCatchUpHook.php b/Neos.Neos/Classes/AssetUsage/CatchUpHook/AssetUsageCatchUpHook.php index 61a115440b..e84c82b9bf 100644 --- a/Neos.Neos/Classes/AssetUsage/CatchUpHook/AssetUsageCatchUpHook.php +++ b/Neos.Neos/Classes/AssetUsage/CatchUpHook/AssetUsageCatchUpHook.php @@ -74,12 +74,6 @@ public function onAfterEvent(EventInterface $eventInstance, EventEnvelope $event } } - if ($eventInstance instanceof WorkspaceWasRebased && $eventInstance->hasSkippedEvents()) { - // because we don't know which changes were discarded in a conflict, we discard all changes and will build up the index on succeeding calls (with the kept reapplied events) - $this->discardWorkspace($eventInstance->getWorkspaceName()); - return; - } - // Note that we don't need to update the index for WorkspaceWasPublished, as updateNode will be invoked already with the published node and then clean up its previous usages in nested workspaces match ($eventInstance::class) { NodeAggregateWithNodeWasCreated::class => $this->updateNode($eventInstance->getWorkspaceName(), $eventInstance->nodeAggregateId, $eventInstance->originDimensionSpacePoint->toDimensionSpacePoint()), @@ -89,6 +83,8 @@ public function onAfterEvent(EventInterface $eventInstance, EventEnvelope $event NodePropertiesWereSet::class => $this->updateNode($eventInstance->getWorkspaceName(), $eventInstance->nodeAggregateId, $eventInstance->originDimensionSpacePoint->toDimensionSpacePoint()), WorkspaceWasDiscarded::class => $this->discardWorkspace($eventInstance->getWorkspaceName()), DimensionSpacePointWasMoved::class => $this->updateDimensionSpacePoint($eventInstance->getWorkspaceName(), $eventInstance->source, $eventInstance->target), + // because we don't know which changes were discarded in a conflict, we discard all changes and will build up the index on succeeding calls (with the kept reapplied events) + WorkspaceWasRebased::class => $eventInstance->hasSkippedEvents() && $this->discardWorkspace($eventInstance->getWorkspaceName()), default => null }; }