Skip to content

Commit

Permalink
TASK: Remove obsolete REBASE_ERROR content stream state
Browse files Browse the repository at this point in the history
Via #4965 the status REBASE_ERROR is obsolete.
Instead of still using this status on replay we mimic the new logic:
> In case of a [rebase error}, reopen the old content stream and remove the newly created

Additionally, to not break `findContentStreams` when fetching all content streams we make sure that the streams with `REBASE_ERROR` are transformed to `NO_LONGER_IN_USE` so they can be cleaned up.

Related neos/neos-development-collection#5101
  • Loading branch information
mhsdesign committed Oct 17, 2024
1 parent 5de72d7 commit 7ab2b55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Classes/Service/ContentStreamPruner.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ public function __construct(
* To remove the deleted Content Streams,
* call {@see ContentStreamPruner::pruneRemovedFromEventStream()} afterwards.
*
* By default, only content streams in STATE_NO_LONGER_IN_USE and STATE_REBASE_ERROR will be removed.
* By default, only content streams that are NO_LONGER_IN_USE will be removed.
* If you also call with $removeTemporary=true, will delete ALL content streams which are currently not assigned
* to a workspace (f.e. dangling ones in FORKED or CREATED.).
* to a workspace (f.e. dangling ones in FORKED, CLOSED or CREATED.).
*
* @param bool $removeTemporary if TRUE, will delete ALL content streams not bound to a workspace
* @return iterable<int,ContentStreamId> the identifiers of the removed content streams
*/
public function prune(bool $removeTemporary = false): iterable
{
$status = [ContentStreamStatus::NO_LONGER_IN_USE, ContentStreamStatus::REBASE_ERROR];
$status = [ContentStreamStatus::NO_LONGER_IN_USE];
if ($removeTemporary) {
$status[] = ContentStreamStatus::CREATED;
$status[] = ContentStreamStatus::FORKED;
Expand Down
8 changes: 0 additions & 8 deletions Classes/SharedModel/Workspace/ContentStreamStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@ enum ContentStreamStatus: string implements \JsonSerializable
*/
case IN_USE_BY_WORKSPACE = 'IN_USE_BY_WORKSPACE';

/**
* a workspace was tried to be rebased, and during the rebase an error occured. This is the content stream
* which contains the errored state - so that we can recover content from it (probably manually)
*
* @deprecated legacy status, FIXME clean up! https://github.com/neos/neos-development-collection/issues/5101
*/
case REBASE_ERROR = 'REBASE_ERROR';

/**
* the content stream was closed and must no longer accept new events
*/
Expand Down

0 comments on commit 7ab2b55

Please sign in to comment.