You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Updating a JTI child sends OnCreate to its parent roles #59
Updating an entity of a joined-table-inheritance hierarchy dispatches OnCreate, not OnUpdate, to its parent roles. EventDrivenCommandGenerator::generateParentStoreCommand() always builds new OnCreate(...), and only the queued command depends on $isNew. So on update the parent's CreatedAt listener rewrites created_at (UPDATE documents SET … created_at = <now>), and the parent's OnUpdate listeners, such as UpdatedAt or OptimisticLock, never run.
Is this a regression?
Not checked.
To Reproduce
A JTI parent Document with #[CreatedAt] and #[UpdatedAt], and a child Invoice with #[JoinedTable].
Persist an Invoice, then change a field and persist it again.
The UPDATE documents statement resets created_at to the current time, and updated_at stays unset.
Expected behaviour
On update the parent roles get OnUpdate, as the child does: created_at stays as it was and updated_at changes.
Activity