Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: cr:prune does not remove all events in eventstore #5220

Closed
dlubitz opened this issue Aug 23, 2024 · 1 comment · Fixed by #5297
Closed

BUG: cr:prune does not remove all events in eventstore #5220

dlubitz opened this issue Aug 23, 2024 · 1 comment · Fixed by #5297
Assignees

Comments

@dlubitz
Copy link
Contributor

dlubitz commented Aug 23, 2024

If you try to prune the contentrepository with the command ./flow cr:prune all contentstream ids get fetched and all events with the given contentstreamids get deleted.

BUT not all contentstream ids are listed in the projection anymore, so we are not able to remove all events with this approach.

We need to find another way to remove the events in the eventstore. But the eventstore (interface) doesn't provide any useful yet.

@mhsdesign
Copy link
Member

jup this is a know bug (dub of #4913) and i found a good way to do this see:

        $events = $this->eventStore->load(
             VirtualStreamName::forCategory(ContentStreamEventStreamName::EVENT_STREAM_NAME_PREFIX),
             EventStreamFilter::create(
                 EventTypes::create(
                     EventType::fromString('ContentStreamWasCreated'),
                     EventType::fromString('ContentStreamWasForked')
                 )
             )
         );
         $allContentStreamEventStreamNames = [];
         foreach ($events as $eventEnvelope) {
             $allContentStreamEventStreamNames[] = $eventEnvelope->streamName;
         }

by filtering via the EventTypes this shouldnt be too expensive :)

... will be fixed via #5297

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants