-
-
Notifications
You must be signed in to change notification settings - Fork 234
ES CR: Reference properties #3849
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nezaniel I love this feature and the change :) I have some nitpick comments / questions, which we can as well discuss via a call next week.
All the best,
Sebastian
'name' => $event->referenceName, | ||
'position' => $position, | ||
'nodeanchorpoint' => $nodeAnchorPoint, | ||
'destinationnodeaggregateidentifier' => $reference->targetNodeAggregateIdentifier, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we unify the naming here or is there a reason for 2 different names?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's unify it, should be consistent from command to read model imho
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, it's now source->target everywhere
@@ -27,30 +27,30 @@ final class NodeReferencesWereSet implements | |||
public function __construct( | |||
public readonly ContentStreamIdentifier $contentStreamIdentifier, | |||
public readonly NodeAggregateIdentifier $sourceNodeAggregateIdentifier, | |||
public readonly OriginDimensionSpacePoint $sourceOriginDimensionSpacePoint, | |||
public readonly NodeAggregateIdentifiers $destinationNodeAggregateIdentifiers, | |||
public readonly OriginDimensionSpacePointSet $affectedSourceOriginDimensionSpacePoints, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't fully understand why this now has an OriginDimensionSpacePointSet here :) -> Comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's for property scopes, a comment seems to be helpful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment has been added
@@ -125,6 +125,7 @@ protected function getCurrentSubgraphs(): ContentSubgraphs | |||
{ | |||
$currentSubgraphs = []; | |||
foreach ($this->getActiveContentGraphs() as $adapterName => $contentGraph) { | |||
$contentGraph->disableCache(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uh, why is this needed? I am not sure this is correct actually, but it might mask actual errors during the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that you mention it, there seem to be caching issues that should be resolved instead. Will have a look at it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
): void { | ||
$nodeType = $this->nodeTypeManager->getNodeType((string)$nodeTypeName); | ||
// initialize node type | ||
$nodeType->getOptions(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we still need this initialization?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, we don't :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has been removed
new NodeReferencesWereSet( | ||
$command->contentStreamIdentifier, | ||
$command->sourceNodeAggregateIdentifier, | ||
$affectedOrigins, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, now I understand it. Still I guess we should add a comment in the event what the semantics of multiple affectedOrigins are.
return new SerializedPropertyValue(null, (string)$propertyType); | ||
} | ||
} catch (PropertyTypeIsInvalid $exception) { | ||
if ($exception->getCode() === 1630063406 && $propertyValue === null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we somehow change this code? Especially checking for an exception code is weird here IMHO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually resurrected that part of code from a dead path...
Maybe we can simply remove the outer try/catch.
The original idea from $back then is that by setting a non existent property to null we would be able to unset the property altogether. That didn't survive the introduction of property checks though and has zero test coverage. So... should we just drop it? Unsetting obsolete properties is covered by integrity checks I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "unset properties" feature has been restored on command level, tests will follow in a later PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nezaniel awesome :) Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GREAT :) :) :)
This introduces references as first class citizens:
Checklist
FEATURE|TASK|BUGFIX
!!!
and have upgrade-instructions