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
It would make debugging easier, if delta instance kept a history of all deltas by which it was transformed, with all additional information that is needed to recreate that delta from it's original state to current state.
This is important to debug OT.
The text was updated successfully, but these errors were encountered:
Delta#history is created and filled automatically when engine/model/delta/transform~deltaTransform#transform is used, if engine debugging is on (engine/dev-utils/enableenginedebug~enableEngineDebug was called).
Delta#history is an array. Each item is an object containing properties:
{String} before - JSON string containing delta state before transformation,
{String} transformedBy - JSON string containing delta which before was transformed by,
{Boolean} wasImportant - whether before was more important than transformedBy when it was transformed,
{Number} resultsTotal - how many deltas were returned as the transformation result,
{Number} resultIndex - what was the index of that delta in the transformation result.
This info will let us recreate all steps which led to current delta state, even if it was transformed multiple times. First item's before property is the original delta. Then it has to be transformed by transformBy deltas of following items (using wasImportant). After each transformation, resultIndex delta has to be chosen from among returned deltas.
Non-first before values and resultsTotal values can be used for additional checking or when there is no need to perform transformation back from the original delta. Those could be omitted/removed if we don't want them.
Note: before and transformedBy JSON strings do not contain their own history properties. That would lead to enormous data duplication.
I did some changes to how functions are exported in delta/transform.js. Fortunately, there are only two repositories which uses those - engine and undo (however in undo it should be changed anyway).
I found those changes the only sane way to enable this feature without transformation algorithms directly "doing something" when "debugging is enabled". Unfortunately this is the only way to substitute/overwrite functions and it probably is not possible if transform.js methods are exported as singular functions.
Feature: When engine debugging is on, deltas that are results of transformation will keep their history of changes in `#history` property. Closes #940.
mlewand
transferred this issue from ckeditor/ckeditor5-engine
Oct 9, 2019
It would make debugging easier, if delta instance kept a history of all deltas by which it was transformed, with all additional information that is needed to recreate that delta from it's original state to current state.
This is important to debug OT.
The text was updated successfully, but these errors were encountered: