Skip to content

Commit

Permalink
TASK: Update neos/eventstore packages to 1.0
Browse files Browse the repository at this point in the history
Updates `neos/eventstore` and `neos/eventstore-doctrineadapter` packages to their first final release and adjusts code accordingly.

Furthermore this incorporates the following changes:

* Add `CheckpointStorageInterface` and its implementation `DbalCheckpointStorage` (aka `DoctrineCheckpointStorage`) from `neos/eventstore-doctrineadapter` (see neos/eventstore-doctrineadapter#13)
* Add `CatchUp` from `neos/eventstore` (see neos/eventstore#19)
  • Loading branch information
bwaidelich committed Jan 21, 2024
1 parent b55aa37 commit 42103d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Event/ValueObject/ExportedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static function fromRawEvent(Event $event): self
$event->id->value,
$event->type->value,
\json_decode($event->data->value, true),
$event->metadata->value,
$event->metadata?->value ?? [],
);
}

Expand Down
15 changes: 7 additions & 8 deletions src/Processors/EventStoreImportProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,19 +159,18 @@ public function run(): ProcessorResult
*/
private function normalizeEvent(EventInterface|DecoratedEvent $event): Event
{
if ($event instanceof DecoratedEvent) {
$eventId = $event->eventId;
$eventMetadata = $event->eventMetadata;
$event = $event->innerEvent;
} else {
$eventId = EventId::create();
$eventMetadata = EventMetadata::none();
}
$eventId = $event instanceof DecoratedEvent ? $event->eventId : EventId::create();
$eventMetadata = $event instanceof DecoratedEvent ? $event->eventMetadata : null;
$causationId = $event instanceof DecoratedEvent ? $event->causationId : null;
$correlationId = $event instanceof DecoratedEvent ? $event->correlationId : null;
$event = $event instanceof DecoratedEvent ? $event->innerEvent : $event;
return new Event(
$eventId,
$this->eventNormalizer->getEventType($event),
$this->eventNormalizer->getEventData($event),
$eventMetadata,
$causationId,
$correlationId,
);
}

Expand Down

0 comments on commit 42103d1

Please sign in to comment.