Skip to content

Commit 82531cc

Browse files
committed
BUGFIX: Adjust to renamed correlation- and causationIdentifier
See neos/eventstore#4
1 parent 0bffd9a commit 82531cc

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

Neos.ContentRepository.Core/Classes/EventStore/DecoratedEvent.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ public static function withEventId(DecoratedEvent|EventInterface $event, EventId
3333
return new self($event->innerEvent, $eventId, $event->eventMetadata);
3434
}
3535

36-
public static function withCausationIdentifier(
36+
public static function withCausationId(
3737
DecoratedEvent|EventInterface $event,
38-
EventId $causationIdentifier
38+
EventId $causationId
3939
): self {
4040
$event = self::wrapWithDecoratedEventIfNecessary($event);
4141
$eventMetadata = $event->eventMetadata->value;
42-
$eventMetadata['causationIdentifier'] = $causationIdentifier->value;
42+
$eventMetadata['causationId'] = $causationId->value;
4343

4444
return new self($event->innerEvent, $event->eventId, EventMetadata::fromArray($eventMetadata));
4545
}

Neos.ContentRepository.Core/Classes/Feature/Common/NodeAggregateEventPublisher.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static function enrichWithCommand(
3636
Events $events,
3737
): Events {
3838
$processedEvents = [];
39-
$causationIdentifier = null;
39+
$causationId = null;
4040
$i = 0;
4141
foreach ($events as $event) {
4242
if ($event instanceof DecoratedEvent) {
@@ -77,11 +77,11 @@ public static function enrichWithCommand(
7777
]);
7878
$event = DecoratedEvent::withMetadata($event, $metadata);
7979
// we remember the 1st event's identifier as causation identifier for all the others
80-
$causationIdentifier = $event->eventId;
80+
$causationId = $event->eventId;
8181
} else {
8282
// event 2,3,4,...n get a causation identifier set, as they all originate from the 1st event.
83-
if ($causationIdentifier !== null) {
84-
$event = DecoratedEvent::withCausationIdentifier($event, $causationIdentifier);
83+
if ($causationId !== null) {
84+
$event = DecoratedEvent::withCausationId($event, $causationId);
8585
}
8686
}
8787
$processedEvents[] = $event;

Neos.ContentRepository.Export/src/Processors/EventStoreImportProcessor.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ public function run(): ProcessorResult
7979
->processMetadata(static function(array $metadata) use ($eventIdMap) {
8080
$processedMetadata = $metadata;
8181
/** @var string|null $causationId */
82-
$causationId = $processedMetadata['causationIdentifier'] ?? null;
82+
$causationId = $processedMetadata['causationId'] ?? null;
8383
if ($causationId !== null && array_key_exists($causationId, $eventIdMap)) {
84-
$processedMetadata['causationIdentifier'] = $eventIdMap[$causationId];
84+
$processedMetadata['causationId'] = $eventIdMap[$causationId];
8585
}
8686
/** @var string|null $correlationId */
87-
$correlationId = $processedMetadata['correlationIdentifier'] ?? null;
87+
$correlationId = $processedMetadata['correlationId'] ?? null;
8888
if ($correlationId !== null && array_key_exists($correlationId, $eventIdMap)) {
89-
$processedMetadata['correlationIdentifier'] = $eventIdMap[$correlationId];
89+
$processedMetadata['correlationId'] = $eventIdMap[$correlationId];
9090
}
9191
return $processedMetadata;
9292
});

0 commit comments

Comments
 (0)