-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix(graph-edge): fix graph edge delete exception #12025
fix(graph-edge): fix graph edge delete exception #12025
Conversation
@@ -190,7 +190,10 @@ private void handleDeleteChangeEvent( | |||
urn.getEntityType(), event.getAspectName())); | |||
} | |||
|
|||
RecordTemplate aspect = event.getRecordTemplate(); | |||
final RecordTemplate aspect = |
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.
Why can we end up with a null
aspect? Seems that some of the implementations from RecordTemplate
can be either Nullable
and Nonnull
Just curious if might be just better to return an empty record template that handling a mix of Nullable
and Nonnull
that could end up in NPEs.
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 MCL usually contains both a current aspect and a previous aspect, the previous aspect is null when the aspect is being first created. For a delete, it doesn't make sense that the current aspect would be populated necessarily. I would expect a previous aspect unless we hit a third case which is a delete of the key aspect of an entity which should technically be added separately but is complete redundant with the entity urn.
In any case, we need to respect that the data model defined both current and previous as optional here and here. Changing the model is a backwards incompatible change.
4e80d67
to
6e74538
Compare
9617d37
to
39be9f1
Compare
39be9f1
to
09ba17e
Compare
Fixing an exception that occurs when deleting graph edges when the MCL is missing the record template. Code updated to check the previous aspect and the current aspect during a delete.
Additionally, if both aspects are missing avoid an exception and log a warning.
Checklist