-
-
Notifications
You must be signed in to change notification settings - Fork 224
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
BUGFIX: Ensure that its not attempted to publish 0 events #5396
base: 9.0
Are you sure you want to change the base?
BUGFIX: Ensure that its not attempted to publish 0 events #5396
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.
Looks good by reading.
SetNodeProperties
is not handled emptySetNodeProperties
is not handled empty
> InvalidArgumentException (1733394351): The command "SetNodeProperties" for node lady-eleonode-rootford must contain property values We want a NodeAggregateIsRoot exception
by enforcing this via "non-empty-array" we can better catch runtime type errors beforehand via phpstan. As otherwise the event store will fail with > Writable events must contain at least one event Some internal utility methods previously also returned possibly empty "Events" instances which were then transformed via iterator_to_array back to arrays and merged. This was not simplified to just work with arrays directly to denote that they might be empty. In cases were we work with fully sure filled intermediate event arrays we use non-empty-array. With this now fine-grained type checking aside from the original found set properties error following cases will also break with 0 events: - handleSetSerializedNodeProperties (known) - handleSetSerializedNodeReferences - handlePublishWorkspace and handlePublishIndividualNodesFromWorkspace if there were no applied events that implement PublishableToWorkspaceInterface -> goes into direction of neos#5337 - structure adjustment TETHERED_NODE_WRONGLY_ORDERED
ce53a0f
to
f0fc051
Compare
Okay before i wanted to merge this i had the feeling we might be missing more such cases ... thats why i attempted to ensure that by enforcing this via "non-empty-array" we can better catch runtime type errors beforehand via phpstan. As otherwise the event store will fail with
Some internal utility methods previously also returned possibly empty "Events" instances which were then transformed via With this now fine-grained type checking aside from the original found set properties error following cases will also break with 0 events:
|
…RONGLY_ORDERED EventsToPublish must not contain events with no entries otherwise this error is thrown > Writable events must contain at least one event we prevent that by ensuring reorderNodes is called with at least two entries of nodes to be reordered as otherwise there is nothing to do.
it does not understand that the command fields are never empty ... but we ensure that
The event store would reject that: > Writable events must contain at least one event
SetNodeProperties
is not handled empty
okay phpstan is happy now and helped me get all the edge cases ... so im happy too ... as this got some new lines changed im requesting a second look before merging this but this seems like a solid sane change |
followup to #5357
see #5357 (comment)
currently
SetNodeProperties
with 0 properties attempts to publish 0 events which throws an error since #5357Instead we throw an exception in
SetNodeProperties
. We DONT expectPropertyValuesToWrite
to be empty as suggested: #5357 (comment)As there is code using
PropertyValuesToWrite
as builder andUpgrade instructions
Review instructions
Checklist
FEATURE|TASK|BUGFIX
!!!
and have upgrade-instructions