Skip to content
Merged
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 @@ -46,7 +46,6 @@ Feature: Remove NodeAggregate
| Key | Expected |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nodingers-cat" |
| affectedOccupiedDimensionSpacePoints | [[]] |
| affectedCoveredDimensionSpacePoints | [[]] |
Then I expect the graph projection to consist of exactly 2 nodes
And I expect a node identified by cs-identifier;lady-eleonode-rootford;{} to exist in the content graph
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ Feature: Remove NodeAggregate
| Key | Expected |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nodingers-cat" |
| affectedOccupiedDimensionSpacePoints | [{"language":"en"}] |
| affectedCoveredDimensionSpacePoints | [{"language":"de"},{"language":"gsw"}] |
Then I expect the graph projection to consist of exactly 4 nodes
And I expect a node identified by cs-identifier;lady-eleonode-rootford;{} to exist in the content graph
Expand Down Expand Up @@ -195,7 +194,6 @@ Feature: Remove NodeAggregate
| Key | Expected |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nodingers-cat" |
| affectedOccupiedDimensionSpacePoints | [{"language":"de"},{"language":"en"}] |
| affectedCoveredDimensionSpacePoints | [{"language":"de"},{"language":"en"},{"language":"gsw"},{"language":"fr"}] |
Then I expect the graph projection to consist of exactly 2 nodes
And I expect a node identified by cs-identifier;lady-eleonode-rootford;{} to exist in the content graph
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ Feature: Change node aggregate type - behavior of DELETE strategy
| workspaceName | "live" |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nodingers-cat" |
| affectedOccupiedDimensionSpacePoints | [{"language":"de"},{"language":"gsw"}] |
| affectedCoveredDimensionSpacePoints | [{"language":"de"},{"language":"gsw"}] |
And event at index 14 is of type "NodeAggregateTypeWasChanged" with payload:
| Key | Expected |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ Feature: Disable a node aggregate
| workspaceName | "live" |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nody-mc-nodeface" |
| affectedOccupiedDimensionSpacePoints | [{}] |
| affectedCoveredDimensionSpacePoints | [{}] |

When the command CreateNodeAggregateWithNode is executed with payload:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,6 @@ private function removeNodeInDimensionSpacePointSet(
$contentGraph->getWorkspaceName(),
$contentGraph->getContentStreamId(),
$nodeAggregate->nodeAggregateId,
// TODO: we also use the covered dimension space points as OCCUPIED dimension space points
// - however the OCCUPIED dimension space points are not really used by now
// (except for the change projector, which needs love anyways...)
OriginDimensionSpacePointSet::fromDimensionSpacePointSet(
$coveredDimensionSpacePointsToBeRemoved
),
$coveredDimensionSpacePointsToBeRemoved,
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public function __construct(
public WorkspaceName $workspaceName,
public ContentStreamId $contentStreamId,
public NodeAggregateId $nodeAggregateId,
public OriginDimensionSpacePointSet $affectedOccupiedDimensionSpacePoints,
public DimensionSpacePointSet $affectedCoveredDimensionSpacePoints,
?NodeAggregateId $removalAttachmentPoint = null
) {
Expand Down Expand Up @@ -72,7 +71,6 @@ public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspa
$targetWorkspaceName,
$contentStreamId,
$this->nodeAggregateId,
$this->affectedOccupiedDimensionSpacePoints,
$this->affectedCoveredDimensionSpacePoints,
$this->removalAttachmentPoint
);
Expand All @@ -84,7 +82,6 @@ public static function fromArray(array $values): self
WorkspaceName::fromString($values['workspaceName']),
ContentStreamId::fromString($values['contentStreamId']),
NodeAggregateId::fromString($values['nodeAggregateId']),
OriginDimensionSpacePointSet::fromArray($values['affectedOccupiedDimensionSpacePoints']),
DimensionSpacePointSet::fromArray($values['affectedCoveredDimensionSpacePoints']),
isset($values['removalAttachmentPoint'])
? NodeAggregateId::fromString($values['removalAttachmentPoint'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ private function handleRemoveNodeAggregate(
$contentGraph->getWorkspaceName(),
$contentGraph->getContentStreamId(),
$command->nodeAggregateId,
$command->nodeVariantSelectionStrategy->resolveAffectedOriginDimensionSpacePoints(
$nodeAggregate->getOccupationByCovered($command->coveredDimensionSpacePoint),
$nodeAggregate,
$this->getInterDimensionalVariationGraph()
),
$command->nodeVariantSelectionStrategy->resolveAffectedDimensionSpacePoints(
$command->coveredDimensionSpacePoint,
$nodeAggregate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,6 @@ public function resolveAffectedDimensionSpacePoints(
};
}

public function resolveAffectedOriginDimensionSpacePoints(
OriginDimensionSpacePoint $referenceDimensionSpacePoint,
NodeAggregate $nodeAggregate,
InterDimensionalVariationGraph $variationGraph
): OriginDimensionSpacePointSet {
return match ($this) {
self::STRATEGY_ALL_VARIANTS => $nodeAggregate->occupiedDimensionSpacePoints,
self::STRATEGY_ALL_SPECIALIZATIONS => OriginDimensionSpacePointSet::fromDimensionSpacePointSet(
$variationGraph->getSpecializationSet($referenceDimensionSpacePoint->toDimensionSpacePoint())
)->getIntersection($nodeAggregate->occupiedDimensionSpacePoints)
};
}

public function equals(self $other): bool
{
return $this === $other;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,11 @@ private function removeNodeInSingleDimensionSpacePoint(
NodeAggregate $nodeAggregate,
DimensionSpacePoint $dimensionSpacePoint
): EventsToPublish {
$referenceOrigin = OriginDimensionSpacePoint::fromDimensionSpacePoint($dimensionSpacePoint);
$events = Events::with(
new NodeAggregateWasRemoved(
$this->contentGraph->getWorkspaceName(),
$this->contentGraph->getContentStreamId(),
$nodeAggregate->nodeAggregateId,
$nodeAggregate->occupiesDimensionSpacePoint($referenceOrigin)
? new OriginDimensionSpacePointSet([$referenceOrigin])
: new OriginDimensionSpacePointSet([]),
new DimensionSpacePointSet([$dimensionSpacePoint]),
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ private function removeNodeAggregate(ContentGraphInterface $contentGraph, NodeAg
$contentGraph->getWorkspaceName(),
$contentGraph->getContentStreamId(),
$tetheredNodeAggregate->nodeAggregateId,
$tetheredNodeAggregate->occupiedDimensionSpacePoints,
$tetheredNodeAggregate->coveredDimensionSpacePoints,
)
);
Expand Down
36 changes: 11 additions & 25 deletions Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,32 +284,18 @@ private function whenNodeAggregateWasRemoved(NodeAggregateWasRemoved $event): vo
]
);

foreach ($event->affectedOccupiedDimensionSpacePoints as $occupiedDimensionSpacePoint) {
$this->dbal->executeStatement(
'INSERT INTO ' . $this->tableNamePrefix . '
(contentStreamId, nodeAggregateId, originDimensionSpacePoint,
originDimensionSpacePointHash, created, deleted, changed, moved, removalAttachmentPoint)
VALUES (
:contentStreamId,
:nodeAggregateId,
:originDimensionSpacePoint,
:originDimensionSpacePointHash,
0,
1,
0,
0,
:removalAttachmentPoint
)
',
[
'contentStreamId' => $event->contentStreamId->value,
'nodeAggregateId' => $event->nodeAggregateId->value,
'originDimensionSpacePoint' => json_encode($occupiedDimensionSpacePoint),
'originDimensionSpacePointHash' => $occupiedDimensionSpacePoint->hash,
/** legacy information: {@see Change::getLegacyRemovalAttachmentPoint()} */
'removalAttachmentPoint' => $event->removalAttachmentPoint?->value,
]
foreach ($event->affectedCoveredDimensionSpacePoints as $coveredDimensionSpacePoint) {
$removalChange = new Change(
$event->contentStreamId,
$event->nodeAggregateId,
OriginDimensionSpacePoint::fromDimensionSpacePoint($coveredDimensionSpacePoint),
created: false,
changed: false,
moved: false,
deleted: true,
removalAttachmentPoint: $event->removalAttachmentPoint
);
$removalChange->addToDatabase($this->dbal, $this->tableNamePrefix);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ Feature: Hard remove node aggregate with node
Then I expect to have the following changes in workspace "user-workspace":
| nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint |
| nody-mc-nodeface | 0 | 0 | 0 | 1 | {"language": "de"} |
| nody-mc-nodeface | 0 | 0 | 0 | 1 | {"language": "gsw"} |
And I expect to have no changes in workspace "live"

Then I expect the publishing of document "nody-mc-nodeface" from workspace "user-workspace" to fail
Expand All @@ -131,6 +132,8 @@ Feature: Hard remove node aggregate with node
Then I expect to have the following changes in workspace "user-workspace":
| nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint |
| nody-mc-nodeface | 0 | 0 | 0 | 1 | {"language": "de"} |
| nody-mc-nodeface | 0 | 0 | 0 | 1 | {"language": "gsw"} |

And I expect to have no changes in workspace "live"

Then I expect the publishing of site "site" from workspace "user-workspace" to fail
Expand Down Expand Up @@ -165,6 +168,7 @@ Feature: Hard remove node aggregate with node
| nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint |
# changed 1 disappears which is not okay
| davids-child | 0 | 0 | 0 | 1 | {"language": "de"} |
| davids-child | 0 | 0 | 0 | 1 | {"language": "gsw"} |
| davids-child | 0 | 1 | 0 | 0 | {"language": "fr"} |
And I expect to have no changes in workspace "live"

Expand Down Expand Up @@ -197,6 +201,7 @@ Feature: Hard remove node aggregate with node
Then I expect to have the following changes in workspace "user-workspace":
| nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint |
| davids-child | 0 | 0 | 0 | 1 | {"language": "de"} |
| davids-child | 0 | 0 | 0 | 1 | {"language": "gsw"} |
| sir-david-nodenborough | 0 | 1 | 0 | 0 | {"language": "de"} |
And I expect to have no changes in workspace "live"

Expand Down Expand Up @@ -236,7 +241,9 @@ Feature: Hard remove node aggregate with node
| nodeAggregateId | created | changed | moved | deleted | originDimensionSpacePoint |
| davids-child | 0 | 1 | 0 | 0 | {"language": "de"} |
| site-two-document | 0 | 0 | 0 | 1 | {"language": "de"} |
| site-two-document | 0 | 0 | 0 | 1 | {"language": "gsw"} |
| nody-mc-nodeface | 0 | 0 | 0 | 1 | {"language": "de"} |
| nody-mc-nodeface | 0 | 0 | 0 | 1 | {"language": "gsw"} |
And I expect to have no changes in workspace "live"

When I publish the 1 changes in site "site" from workspace "user-workspace" to "live"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ Feature: Tests for soft removal garbage collection without impending conflicts
| workspaceName | "live" |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nonly-lively" |
| affectedOccupiedDimensionSpacePoints | [{"example": "source"}] |
| affectedCoveredDimensionSpacePoints | [{"example": "source"}, {"example": "special"}] |

Scenario: Garbage collection will transform a soft removal of a node which is published to live from the only other workspace
Expand All @@ -109,7 +108,6 @@ Feature: Tests for soft removal garbage collection without impending conflicts
| workspaceName | "live" |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nodingers-cat" |
| affectedOccupiedDimensionSpacePoints | [{"example": "source"}] |
| affectedCoveredDimensionSpacePoints | [{"example": "source"}, {"example": "special"}] |

When the command RebaseWorkspace is executed with payload:
Expand Down Expand Up @@ -146,14 +144,12 @@ Feature: Tests for soft removal garbage collection without impending conflicts
| workspaceName | "live" |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nodingers-kittens-plaything" |
| affectedOccupiedDimensionSpacePoints | [{"example": "source"}] |
| affectedCoveredDimensionSpacePoints | [{"example": "source"}, {"example": "special"}] |
And event at index 9 is of type "NodeAggregateWasRemoved" with payload:
| Key | Expected |
| workspaceName | "live" |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nodingers-kitten" |
| affectedOccupiedDimensionSpacePoints | [{"example": "source"}] |
| affectedCoveredDimensionSpacePoints | [{"example": "source"}, {"example": "special"}] |

When the command RebaseWorkspace is executed with payload:
Expand Down Expand Up @@ -201,7 +197,6 @@ Feature: Tests for soft removal garbage collection without impending conflicts
| workspaceName | "live" |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nodingers-kitten" |
| affectedOccupiedDimensionSpacePoints | [{"example": "source"}] |
| affectedCoveredDimensionSpacePoints | [{"example": "source"}, {"example": "special"}] |

# the event for the nested removal is never explicitly emitted; the corresponding command fails and gets caught for now
Expand Down Expand Up @@ -239,7 +234,6 @@ Feature: Tests for soft removal garbage collection without impending conflicts
| workspaceName | "live" |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nodingers-cat" |
| affectedOccupiedDimensionSpacePoints | [{"example": "source"}] |
| affectedCoveredDimensionSpacePoints | [{"example": "source"}] |

When the command RebaseWorkspace is executed with payload:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ Feature: Tests for soft removal garbage collection with impending conflicts caus
| workspaceName | "live" |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nodingers-cat" |
| affectedOccupiedDimensionSpacePoints | [{"example": "source"}] |
| affectedCoveredDimensionSpacePoints | [{"example": "source"}, {"example": "special"}] |

When the command RebaseWorkspace is executed with payload:
Expand Down Expand Up @@ -191,7 +190,6 @@ Feature: Tests for soft removal garbage collection with impending conflicts caus
| workspaceName | "live" |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nodingers-cat" |
| affectedOccupiedDimensionSpacePoints | [{"example": "source"}] |
| affectedCoveredDimensionSpacePoints | [{"example": "source"}, {"example": "special"}] |

When the command RebaseWorkspace is executed with payload:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ Feature: Tests for soft removal garbage collection with impending conflicts caus
| workspaceName | "live" |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nodingers-kitten" |
| affectedOccupiedDimensionSpacePoints | [{"example": "source"}] |
| affectedCoveredDimensionSpacePoints | [{"example": "source"}, {"example": "special"}] |

When the command RebaseWorkspace is executed with payload:
Expand Down Expand Up @@ -262,7 +261,6 @@ Feature: Tests for soft removal garbage collection with impending conflicts caus
| workspaceName | "live" |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nodingers-kitten" |
| affectedOccupiedDimensionSpacePoints | [{"example": "source"}] |
| affectedCoveredDimensionSpacePoints | [{"example": "source"}, {"example": "special"}] |

When the command RebaseWorkspace is executed with payload:
Expand Down
Loading
Loading