Skip to content

Commit

Permalink
TASK: Remove information which nodes were partially published or disc…
Browse files Browse the repository at this point in the history
…arded in the events (for now)

Introduced with neos@f2c66e0 - its not important for the graph projection and only used by the asset usage catchup hook which can be adjusted.

If we want to re-introduce `$publishedNodes` to the event should be also careful that we calculate them from the _actual_ events so we can know for sure there is no gibberish in the event.
Previously for example discarding a non-existing node or a node in a not valid DSP would just save that directly into the event, which is not correct as that did not happen like that. It was merely a bad intention.
  • Loading branch information
mhsdesign committed Nov 30, 2024
1 parent 16da882 commit ac2c359
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 165 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,6 @@ static function ($handle) use ($commandSimulator, $matchingCommands, $remainingC
$baseWorkspace->workspaceName,
$command->contentStreamIdForRemainingPart,
$workspace->currentContentStreamId,
$command->nodesToPublish
)
]),
ExpectedVersion::ANY()
Expand Down Expand Up @@ -644,7 +643,6 @@ static function ($handle) use ($commandsToKeep): void {
$command->workspaceName,
$command->newContentStreamId,
$workspace->currentContentStreamId,
$command->nodesToDiscard,
)
),
ExpectedVersion::ANY()
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

use Neos\ContentRepository\Core\EventStore\EventInterface;
use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateIds;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;

Expand All @@ -34,8 +33,7 @@ public function __construct(
/**
* The old content stream, which contains ALL the data (discarded and non-discarded)
*/
public ContentStreamId $previousContentStreamId,
public NodeAggregateIds $discardedNodes,
public ContentStreamId $previousContentStreamId
) {
}

Expand All @@ -46,21 +44,10 @@ public function getWorkspaceName(): WorkspaceName

public static function fromArray(array $values): self
{
$discardedNodes = [];
foreach ($values['discardedNodes'] as $discardedNode) {
if (is_array($discardedNode)) {
// legacy case:
$discardedNodes[] = $discardedNode['nodeAggregateId'];
continue;
}
$discardedNodes[] = $discardedNode;
}

return new self(
WorkspaceName::fromString($values['workspaceName']),
ContentStreamId::fromString($values['newContentStreamId']),
ContentStreamId::fromString($values['previousContentStreamId']),
NodeAggregateIds::fromArray($discardedNodes),
ContentStreamId::fromString($values['previousContentStreamId'])
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
namespace Neos\ContentRepository\Core\Feature\WorkspacePublication\Event;

use Neos\ContentRepository\Core\EventStore\EventInterface;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateIds;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;

Expand All @@ -41,27 +40,16 @@ public function __construct(
* The old content stream, which contains ALL the data (discarded and non-discarded)
*/
public ContentStreamId $previousSourceContentStreamId,
public NodeAggregateIds $publishedNodes,
) {
}

public static function fromArray(array $values): self
{
$publishedNodes = [];
foreach ($values['publishedNodes'] as $publishedNode) {
if (is_array($publishedNode)) {
// legacy case:
$publishedNodes[] = $publishedNode['nodeAggregateId'];
continue;
}
$publishedNodes[] = $publishedNode;
}
return new self(
WorkspaceName::fromString($values['sourceWorkspaceName']),
WorkspaceName::fromString($values['targetWorkspaceName']),
ContentStreamId::fromString($values['newSourceContentStreamId']),
ContentStreamId::fromString($values['previousSourceContentStreamId']),
NodeAggregateIds::fromArray($publishedNodes),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Command\DiscardWorkspace;
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Command\PublishIndividualNodesFromWorkspace;
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Command\PublishWorkspace;
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdsToPublishOrDiscard;
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdToPublishOrDiscard;
use Neos\ContentRepository\Core\Feature\WorkspaceRebase\Command\RebaseWorkspace;
use Neos\ContentRepository\Core\Feature\WorkspaceRebase\Dto\RebaseErrorHandlingStrategy;
use Neos\ContentRepository\Core\Feature\WorkspaceRebase\Exception\WorkspaceRebaseFailed;
Expand Down

0 comments on commit ac2c359

Please sign in to comment.