Ticket #802 (new Defect)

Opened 5 years ago

Last modified 4 years ago

Core API: since 4.6 the "old model" semantics is broken in post-update listeners

Reported by: jri Owned by: jri
Priority: Major Milestone:
Component: DeepaMehta Standard Distribution Version: 4.6
Keywords: Cc: dgf, Malte
Complexity: 3 Area: Application Framework / API
Module: deepamehta-core

Description

Since DM 4.6 updating topics is more efficient: the core does not load the entire topic to update (including all its child topics) but only the childs that are actually to be updated.

However, as a consequence this breaks the semantics of the oldModel parameter in the post-update listeners. The old model passed to the listeners is no longer guaranteed to contain all the (old) child topics anymore. This might break the working of post-update listeners of pre-4.6 plugins.

No simple workaround is available. The listeners can't load the old model's childs a-posteriori as the childs are already overridden. (As we are in the post-update listener.) A workaround possibly would be to use the pre-update listeners and construct the "old model" yourself.

We want keep the 4.6 optimization mentioned above.

The concept of "old model" needs to be revised basically.

The solution is for the core not to pass a complete (cloned) old model object but a "change record" object which contains only the childs that actually have changed while the update operation. The core would (recursivley) construct the change record object while performing the composite update.

Change History

comment:1 Changed 4 years ago by jri

  • Milestone Release 4.7 deleted
Note: See TracTickets for help on using tickets.