Skip to content

Commit

Permalink
TASK: Check against LiveWorkspaceName Instead Of Comparing CS Ids
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Jun 18, 2024
1 parent 02e71d2 commit acc9fed
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions Classes/CatchUpHook/DocumentUriPathProjectionHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function onAfterCatchUp(): void

private function onBeforeNodeAggregateWasRemoved(NodeAggregateWasRemoved $event): void
{
if (!$this->isLiveContentStream($event->contentStreamId)) {
if (!$event->workspaceName->isLive()) {
return;
}

Expand Down Expand Up @@ -104,7 +104,7 @@ function ($descendantOfNode) use ($event, $dimensionSpacePoint) {

private function onAfterNodeAggregateWasRemoved(NodeAggregateWasRemoved $event): void
{
if (!$this->isLiveContentStream($event->contentStreamId)) {
if (!$event->workspaceName->isLive()) {
return;
}

Expand Down Expand Up @@ -146,7 +146,7 @@ private function onAfterNodePropertiesWereSet(NodePropertiesWereSet $event): voi
*/
private function handleNodePropertiesWereSet(NodePropertiesWereSet $event, \Closure $closure): void
{
if (!$this->isLiveContentStream($event->contentStreamId)) {
if (!$event->workspaceName->isLive()) {
return;
}

Expand Down Expand Up @@ -193,7 +193,7 @@ private function onAfterNodeAggregateWasMoved(NodeAggregateWasMoved $event): voi
*/
private function handleNodeWasMoved(NodeAggregateWasMoved $event, \Closure $closure): void
{
if (!$this->isLiveContentStream($event->contentStreamId)) {
if (!$event->workspaceName->isLive()) {
return;
}

Expand Down Expand Up @@ -223,11 +223,6 @@ private function getState(): DocumentUriPathFinder
return $this->contentRepository->projectionState(DocumentUriPathFinder::class);
}

private function isLiveContentStream(ContentStreamId $contentStreamId): bool
{
return $contentStreamId->equals($this->getState()->getLiveContentStreamId());
}

private function findNodeByIdAndDimensionSpacePointHash(NodeAggregateId $nodeAggregateId, string $dimensionSpacePointHash): ?DocumentNodeInfo
{
try {
Expand Down

0 comments on commit acc9fed

Please sign in to comment.