track cascade deletion in change recorder #48
Merged
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.
This PR adapts the
ChangeRecorder
to create delete changes not only for the element actually deleted, but for all elements that are cascade deleted by it.As an example, if I have an element
a
which contains elementb
and I deletea
, botha
andb
are deleted sincea
is the container ofb
. As of now, we didn't explicitly track the deletion ofb
.As a conceptual motivation we can argue that our change sequence should describe the entire model state change and thus make cascade deletions explicit. From a more practical motivation, we need these changes to replay change sequences backwards. Currently, due to the use of hierarchical IDs this problem is made transparent, i.e. the tests still succeed although some element IDs cannot be resolved. However, as soon as we migrate to UUIDs this is not the case anymore as no UUID is registered for a cascade deleted element when replaying changes backwards.