fix: skip update logs for items whose identifier was cleared on removal - #41
Merged
paullla merged 1 commit intoJul 3, 2026
Merged
Conversation
Deleting a parent entity together with its LoggableChildInterface children dispatches an update log for the parent from the child's delete log. By then Doctrine has cleared the parent's generated identifier, so the current data tracker lookup ran with a null objectId, which Elasticsearch rejects with a 400. Skip the update when the item has no identifier: the parent's own delete log is already written and an edit log for a removed entity is meaningless.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Deleting a parent entity together with its
LoggableChildInterfacechildren crashes the update handler. The child's delete log triggers an update log for the parent (ActivityLogger::handleLoggableChild()), but by then Doctrine has already cleared the parent's generated identifier. The current data tracker lookup then runs a term query withobjectId: null, which Elasticsearch rejects with400 illegal_argument_exception: field name is null or empty, failing the whole flush flow.Found while driving a real application (demo app with
Product->ProductVariantas loggable child) against 2.0-dev.Changes
UpdateActivityLogHandlerreturns early when the updated item's identifier is null: an item without an identifier has no current data tracker to compare against, its own delete log is already written, and an edit log for a removed entity is meaninglessVerification